Hi there!
I need help with my assignment. The point if it is to make an array table that will hold various linked lists that hold other items. I already have my code to add and retrieve information from a linked list. I need help making an array that will look at an input, check if the input is in the list, if it isn't, add it to an empty space. When another input needs to be where memory is taken up already, add it using a linke list instead of a traditional list. I hope this makes sense. Any help would be appreciated. If you need more information, or if your unsure of what I'm asking, please let me know. Any help is appreciated. Thank you very much

Recommended Answers

All 5 Replies

Okay, what do you have so far? It sounds like you're working toward a chained hash table implementation, because the array of linked lists for exact matches is a common collision resolution strategy in hash tables.

I was thinking of implementing a hash table function as you mentioned, but the assignment is to make an array. Now when I insert something into the array I must insert it as a linked list. I already have all the code for the linked list, what I need help in is when I add an item to the array, I should add it as a linke list. This way, I have an array with different linked lists depending on the information given.

>I was thinking of implementing a hash table function as you mentioned, but the assignment is to make an array.
Hash tables are typically implemented as arrays. In this case, an array of linked lists. So the type of your array should be a pointer to the node type:

node *my_array[N] = {0};

so what i shouldo is point the type of the array i create to the node of the linked list?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.