wu :: forums
« wu :: forums - data structure for storinh IP Addresses »

Welcome, Guest. Please Login or Register.
Oct 31st, 2024, 5:37pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: ThudnBlunder, Grimbal, towr, Icarus, SMQ, william wu, Eigenray)
   data structure for storinh IP Addresses
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: data structure for storinh IP Addresses  (Read 2325 times)
witee
Newbie
*





   
Email

Posts: 48
data structure for storinh IP Addresses  
« on: Oct 15th, 2010, 11:06pm »
Quote Quote Modify Modify

you are given n lists of IP addresses for eg. as follows
10.0.0.0,121.32.3.5,192.168.0.1,...
10.4.23.2,169.34.5.1,198.1.1.1,...
...
Design a data structure to store these values so that you will be able  
to fire queries like
a) IP address 10.x.3.x appears in which lists?
b) How many times does 10.4.x.x appear before 192.168.x.x ?
c) How many time does 169.34.5.1 appear?
IP Logged
eenampicchi
Newbie
*





   


Posts: 10
Re: data structure for storinh IP Addresses  
« Reply #1 on: Nov 1st, 2010, 12:46pm »
Quote Quote Modify Modify

Perhaps we can store the addresses as tables of values, with each table containing only information from one list. These tables are akin to database tables, and optimization techniques used on those tables - such as indexes and so on might be applicable here. Query techniques can also be the same as those used in databases.
IP Logged
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: data structure for storinh IP Addresses  
« Reply #2 on: Nov 8th, 2010, 10:00am »
Quote Quote Modify Modify

on Oct 15th, 2010, 11:06pm, witee wrote:
b) How many times does 10.4.x.x appear before 192.168.x.x ?

 
I don't understand this one.  Does it mean: how many times does any 10.4.x.x appear before the first 192.168.x.x in the same list?  For matching x.x's?  Or across all lists?
 
Are the IP addresses unique in each list?
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board