?
Solved

indexing on linked list

Posted on 2003-03-31
6
Medium Priority
?
435 Views
Last Modified: 2008-02-01
Dear Experts,
   
     Can anyone please give me an idea on "indexing on a linked list".
The linked list would have the following description.

something like

struct list
{
  char* str;
  listdetails details;  // structure defined below
  list next;
}

struct listdetails
{
  char* serverip;
  int time;
  typespace adspace;    // another linked list defined below
}
struct typespace
{
  bool status;
  char* value;
  char* default value;
  typespace nextspace;
}


   there may be maximux of 20 elements in the list( it may increase later), hence while searching a particular element i dont want to do a string campare everytime that would not be an optimum code.
   is there is any way i could index the first linked list so that the lookup would be faster.
please get back to me at the earliest.
Regards
Deepika

0
Comment
Question by:Deepikakumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 1

Expert Comment

by:sarda_ramesh
ID: 8244484
Hi Deepika,
  U can have a hashing function to convert the string to soem number and then u can use the number throughout.

regards
ramesh
0
 

Author Comment

by:Deepikakumar
ID: 8245108
Hi Ramesh,

  Thank you,  i actually thought about this idea but was thinking as to how to go about it. I have not done it before. Can you give me some inputs on hashing function please.

Regards
Deepika
0
 
LVL 1

Accepted Solution

by:
sarda_ramesh earned 80 total points
ID: 8245377
Hi Deepika ,
  u can check this link out
http://ciips.ee.uwa.edu.au/~morris/Year2/PLDS210/hash_func.html

regards
ramesh
0
 
LVL 1

Expert Comment

by:sarda_ramesh
ID: 8245395
u can also check the following link..

http://www.maththinking.com/boat/computerbooks.html

or else u can refer to any bool on data and file structure for Hanshing functions.

regards
ramesh
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question