Hacker News new | ask | show | jobs
by ToastyMallows 3712 days ago
> "Just about everything you do in your programming career will be related to trees."

I've never knowingly used a tree structure since college, everything is abstracted away from me. Now whether this is a good thing or a bad thing remains to be seen, but it has not been a problem yet.

2 comments

Have you ever stored a dictionary inside a dictionary? (e.g. something like the JSON:

    {foo : {bar : "baz"}}
That's a tree.
...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.)

A 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).
Very good point. If you write C++, std::set and std::map use trees. And most people who use them don't know that and 99% of the time, that's OK.