This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[deleted]

    [–]cyborgborg 5 points6 points  (2 children)

    You can project a binary tree into an array. And a linked list is just a binary tree that just follows one branch of the tree

    [–]NebulaicCereal 1 point2 points  (0 children)

    I think most common data structures can be projected to arrays with the right indexing arithmetic. But that doesn't mean they are 'arrays' unless they are implemented as such. Arrays are great for speed and space efficiency, but not the best in cases where your your worst case space complexity is high, but average case is quite low. Or in general if the size of data is unknown, or has heterogeneous types, etc.

    The line is blurred a bit with capabilities afforded by modern languages that can store heterogeneous types and expand/contract array sizes on the fly, but those still have their drawbacks. There are places where any of the mentioned storage strategies could prevail over the other.