Subject: Re: Network mask contiguity

From: "Naidu, Venkata" <[email-masked]>
Date: Mon, 15 Dec 2003 10:30:24 -0500

Igor,

-> I absolutely agree with your method, but it feels that there
-> must be a trick
-> with no iteration inside. A couple of lines, some bitwise
-> magic... Don't you consent?

  You can check whether "log((~mask)+1)" is a natural number or not.
  If it is a natural number then mask is contiguous, else it is not.

  Note that, you should not check for whole numbers to avoid
  some degenerate cases. And the asymptotic complexity of
  the above simple algorithm depends on the underlying RAM
  model and arithmetic in hardware.

  If you want to know more, look at some DNA string matching
  and computational biology books.

Venkata.

---

From: Vishwas Manral <[email-masked]>
Date: Mon, 15 Dec 2003 21:28:56 +0200

I think I agree with Venkata.

I got exactly the same idea and thats what I got back to reply.

Cheers,
Vishwas

-----Original Message-----
From: Mailing List [mailto:[email-masked]]On Behalf Of Naidu,
Venkata
Sent: Monday, December 15, 2003 5:30 PM
To: [email-masked]
Subject: Re: Network mask contiguity

Igor,

Venkata.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.551 / Virus Database: 343 - Release Date: 12/11/2003