Exercises
- Week 6
1 Linked lists
Define a generic linked list(a list that can be used with any type).
Use as a starting point the Linked list of integers (week4
code, sequence2sol.zip) and the
generic array (week5
code solution )
2 Hash table
Implement a hash table, with a string (char *) as a key, and int as the
value.
The hash table can use chaining as a mechanism to avoid collisions, and
mod as hash function.
The hash table should be capable of keeping the load factor <75%,
using automatic resize as the
generic array.
As a second step define a generic hash table (char* as a key, TYPE as
the value), using as a starting point
the generic array (week5
code solution ) and the generic linked list
(previous point)
3 Student management with generic data
structures
Re implement the student management program of week 5 (here) using only
generic arrays,
linked lists or hash tables defined in previous steps.
Discuss the complexity of the implementation.
Using predefined data structures such as linked lists, arrays, hash
tables
allows to program more quickly and with less defects.
Note that at the exam you will be able to use and modify predefined
generic data structures that you have developed.