3 ms·
What did people do before dictionaries, maps, etc?
by nonethewiser 4y ago
What did people do before dictionaries, maps, etc?
- qiqitori 4y agoC doesn't have that either. Most commonly people just do a linear search. If you have a bigger array you can either use a library or roll your own almost-hash table-kinda-thing. It's not that complicated to roll your own because you already know your specific type of input. Implementing something that works for "any" type of input is harder.
- haroldl 4y agoI worked on a C project where we counted 14 different hash table implementations done for different key/value data types strewn through the code.
- pjmlp 4y agoWe read books about data structures and algorithms, implemented our own libraries that we carried from project to project. Alternatively, we would buy a library from companies selling developer tools.
- tgv 4y agoYup. I still have avl trees from way back lying around. I've ported them to C++ and recently to Go.
- rwmj 4y agoI wrote some (what would now be called "CRUD") applications back in the 80s in BASIC and later in C, and the answer is arrays and linear searches. 80s BASIC wasn't able to store more than, say, 100-500 user records, so linear searching was fine, even in an interpreted language. If you wanted to get really fancy you might have used something like JETSAM which gave you a single key-value db in a file.