ProgrammerHumor

whyDoWeDrawThemThatWay

whyDoWeDrawThemThatWay
https://i.redd.it/qds6857s2ndf1.png
Reddit

Discussion

Lenni009
:ts::js:

One of my profs once said "computer scientists have never seen a tree, that's why the root is at the top."

19 hours ago
Racer125678

can't seem to find the roots of this inverted tree writing style

18 hours ago
reginakinhi

Look higher up instead of digging deeper into the topic

1 hour ago
Quito246

Are you looking for fruit in depth first search?

16 hours ago
frcdude

You can find the fruit by going down into the tree from the fruit in log n time, but it still takes me Linear time to grow. 

17 hours ago
Piisthree

height-first search? Naaah

16 hours ago
suvlub

(pre-emptive "yes, I get the joke, I just choose to answer the question seriously anyway because I have nothing better to do")

Because they are just called "trees" because they have to be called something and "tree" makes for a nice memorable analogy. They aren't supposed to be trees and there is no particular reason to make them resemble real trees when drawing them. We traditionally read from top to bottom and for most kinds of data and algorithms it's more natural to start at the root than at the leaves, so to the top it goes.

15 hours ago
WarpedHaiku

If you think about it, on computers as the Y coordinate increases you end up further down the screen, which is the opposite of typical X,Y coordinate spaces in real life.

If you were to take some graph paper irl and draw a tree the right way up, and then input those coordinates into a computer, it would appear upside down.

So in one sense, we're technically drawing them the right way up

4 hours ago
neo-raver
:cp::py::rust:

Because the fruit has to reverse the tree from root to leaf, of course!

6 hours ago
grasopper

Because the tree is fruity

4 hours ago