4 ms·
I was confused by that as well before reading the answers: the confusion stemmed from only thinking about the linear traversal or search use cases, where an ord
by usrusr 7y ago
I was confused by that as well before reading the answers: the confusion stemmed from only thinking about the linear traversal or search use cases, where an ordered array plus binary search is all you'd ever need for reading. But when the tree shape itself is still needed, indices can be better than pointers, particularly when adding sidecar arrays for extension or as temporary scribble space (see sibling comment).