2 ms·
LIBXML uses them for in-memory representation of DOM parsed XML. They are also very effective in Trie node structures (http://en.wikipedia.org/wiki/Trie http:/
by GnarfGnarf 13y ago
LIBXML uses them for in-memory representation of DOM parsed XML.
They are also very effective in Trie node structures (http://en.wikipedia.org/wiki/Trie http://en.wikipedia.org/wiki/Trie). They provide super-fast searching of large texts.
I prefer arrays. I experimented with linked lists in my early C days, and this code turned about to be the most bug-prone and hard to maintain. They have their place, but given a choice, arrays are simpler, and faster to code for.
- gizmo686 13y ago>I experimented with linked lists in my early C days, and this code turned about to be the most bug-prone and hard to maintain. I had almost the exact opposite experience. Arrays always felt like I was shuffling indexes around, and needed to do extra bookkeeping to keep track of where I was. Linked-lists seemed more explicit. Granted, I have had times where arrays produced easier code. These tended to be when I need random access (or to backtrack n-elements or such). Furtuantly, these cases also (normally) coincide with the cases where arrays are the more (asymptotically) performant data-structure.