3 ms·
Have you ever stored a dictionary inside a dictionary? (e.g. something like the JSON: {foo : {bar : "baz"}} That's a tree.
by aidenn0 11y ago
Have you ever stored a dictionary inside a dictionary? (e.g. something like the JSON:
{foo : {bar : "baz"}}
That's a tree.
- KingMob 11y ago...unless it's a hashmap inside a hashmap. Or named fields in an object holding pointers that use no keys after compilation. The point being that hierarchical structures in programming languages abstract away from the underlying representation, and you can use them without knowing the details. (Though you should probably know anyway, so you understand your Big-O tradeoffs.)
- aidenn0 11y agoA hashmap inside of a hashmap is just as much of a tree as an array inside of an array (which for a 2 element array describes a binary tree).