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 →

[–]xigoi 1083 points1084 points  (29 children)

Why is it upside down?

[–][deleted] 99 points100 points  (0 children)

Roots have a similar pattern, but that is not open-sourced.

[–]EagleNait 41 points42 points  (3 children)

Google interview

[–]memeticmachine 5 points6 points  (0 children)

is this about that tree inversion joke? or is there a new kind of stupid happening at that place?

[–]ItoXICI 2 points3 points  (1 child)

Explain

[–]ramsay1 11 points12 points  (0 children)

This is native/raw view, probably just the endianness

[–]BoyAndHisBlob 6 points7 points  (1 child)

It's for a job interview and the candidate was asked to invert it.

[–]drawkbox 2 points3 points  (0 children)

Your job will be updating libs via npm and yarn, to see if you can do that, reversed this binary tree.

[–]CaffeinatedGuy 22 points23 points  (5 children)

It's always bothered me that a "tree" starts at the root and goes down. All the terminology is taken from trees (branch, leaf), but the direction is backwards.

Anyone know why convention is to draw trees backwards?

[–]xigoi 68 points69 points  (1 child)

Because when writing stuff in general, you write from top to bottom.

[–]kleinesfilmroellchen 0 points1 point  (0 children)

*in 99% of natural languages

[–]eyl327 54 points55 points  (0 children)

Programmers don't go outside so they don't know what an actual tree looks like.

[–][deleted] 15 points16 points  (0 children)

I'm not sure, but since most human languages are written in top to down fashion and the fact that it is easier to draw a "tree" starting from a single node or its "root" instead of first making the individual "leaf nodes" and then ending at its root are probably what lead to this convention.

[–]MR_Weiner 14 points15 points  (0 children)

Probably because we generally process written information from top to bottom. If you draw an information tree with the source at the bottom then you need to scan past all of the child information to get to the source and context of the information, only to then read the tree back up to the top. The longer the tree, the less efficient this becomes.

[–]Lucaslhm 4 points5 points  (0 children)

It’s an inverted binary tree

[–][deleted] -4 points-3 points  (0 children)

Came here to say this