Showing posts with label binary trees. Show all posts
Showing posts with label binary trees. Show all posts

Friday, 6 December 2013

Binary Trees: Not Quite Like Family Trees

From http://lcm.csa.iisc.ernet.in/dsa/img151.gif
     I can already tell now that I'm going to have issues recursing over binary trees, let alone remembering how to implement the three versions of even listing all their items.

     I don't know if I'm just so used to seeing flat lists that I'm simply not used to them yet, but they look so strange. Besides, it must be a nightmare if you have a sorted binary tree and decide to delete a node. How do you rearrange it so it stays ordered? I looked at the Wikipedia section on the topic, but it looks like the closer the node you want to delete is to the root, the better it would be to simply power off the computer and go watch a movie.