reading-notes

401 class 15 notes

Why this matters: This information matters because trees are data structures that we can use to solve technical problems!


Trees are sort of like family trees, except with weird societal rules.

Binary trees live in a world where everybody who has at least one kid is a single parent and there’s a two child max law. If a node has two kids, one must be left-handed and one must be right-handed. Not everybody will have kids, and some will have one.

K-ary trees live in a world where they can have 0 up to K number of kids. They’re also always single parents, and there’s no rules about whether kids are left or right-handed.

For both, the root node is the matriarch/patriarch/theytriarch, and they can dequeue to go on vacation from their crazy family, in which they make everybody do a minivan shuffle. When this happens, all of the monarch’s children are enqueued into a minivan queue, and when the first child dequeues the queue, that first child’s kids then get enqueued to the back of the queueue, behind it’s aunts and uncles. This dequeue/enqueue process happens at the front of the queue until the queue is empty of children.


Things I Want To Know More About:

Nothing at the moment!