Creating Hashtable Using C (Username & Password Authenticator)
What you need to know before starting to learn Hashtables in C
- Dynamic Memory Allocation (Malloc).
- How to create a List using Structures.
- How to create a Hashtable
- Creathe the Structure with the data(username & password) + one more variable that is the same Structure type as the one you created. For Example:
- Make a dynamical 1-D array (malloc)
- The “T” array should contain all the “Heads” of the Lists (*(T+index)=NULL)
- If there is no “item” in *(array + example_index) add it there.
- Else (if there is already one item in possition *(array + example_index) ) create a new node add it there, Like so:
- The method hash() give’s you the “example_index” (the location of the item).
- Write your own code, to fully understand HashTables.
- Use this as Guidance.