You would probably do this using a linked list. I recommend Algorithms in C by Robert Sedgewick for an introduction in linked lists, binary trees, searching, etc.
Since this is a Mac programming forum, you could also check out some Cocoa API like NSMutableDictionary.