So this week
was about binary search trees and how to use them to sort data in a useful
format. Essentially, binary search trees are a series of nodes each containing
a left node and a right node along with a value, root. It is organized by
relative size to one another in that all items that is greater than the root
goes on the right side of the node in question, and everything that is smaller
than the root goes on the left side. It was also learned that the binary search
tree is recursive in nature and it makes sense due to the property of the nodes
in that it potentially has a left and or right node. Therefore at any given
node, it may branch into two “separate” binary tree with all the properties of
a binary search tree intact.
I remember
doing this back in high school however I realize that we have never touched
recursion. Yet alone finding items in a pre-built binary search tree. However,
considering that I am aware of how binary search trees work and know it
behaves, I’m confident that the only thing I need to work on is the technical
aspect of having to manipulate the nodes in Python rather than Java.
No comments:
Post a Comment