Unfortunately I didn't take a picture of his diagram, but this image sort of shows the same thing: each node links to another node, or null. I'm still feeling a little shaky on his explanation, because I thought recursion was more of a strategy for an algorithm rather than inherently in a data structure.
Sam also wrote up and explained a cool C file that emulates the car, cdr, and cons LISP functions in C, so I have a better understanding of what those actually are doing now.
This program outputs
6 7 8 3 2 1
I also got further in the EIMACS binary search tree curriculum. They still haven't explained what makes a balanced search tree balanced, so I'm a little confused as to the significance. I'm pretty sure it's because that way you can guarantee that the sorted tree has the elements where you think they are, because otherwise it could be arbitrary (I know that's vague, I'll try to expand on that on Monday but I'm running out of time.)
I would recommend looking at the NIST site for clear, well written definitions of these very important tree concepts:
ReplyDeletehttp://xlinux.nist.gov/dads/HTML/balancedbitr.html