i’m doing a self project or call it what you will, i’m creating a phone book – dictionary type which allows UNLIMITED unique Names and per Names allows UNLIMITED phone numbers so pretty much linked list all the way right? an yeah no static arrays… :/ since it data is unlimited so to speak.. so my question is…IS THERE A BETTER WAY? anyone has some ideas? unlimited yet unique person names then each person can have unlimted set of phone numbers?
Share
You could try to use a self-balancing binary search tree or some sort of hash table.
More info see below.
Self-balancing binary search tree
Hash-table
Implementing it as a hash table might be simpler if you’ve never done this before. I’d recommend reading a book on algorithms and data structures. Some resources follow.
The algorithm design manual
Algorithms by Sedgewick
Algorithms in C
Of course if you are not interested in the details you can use an existing library for this or some sort of database.