Friday, 18 March 2016

CSC148 Week 9

This week we had our second term test on Wednesday (March 16). It covered LinkedList, LinkedListNode, Trees, Binary Trees, and Binary Search Trees and recursion. I thought the test was pretty fair, we had more than enough time to finish it and all the questions were answerable.

During lecture time, we learned about Binary Search Trees this week. A Binary Search Tree is a Binary Tree where each node has up to two children, a right child and a left child. A node's left child is less than the node's data and a node's right child is greater than a node's data. A Binary Search Tree can be used to find a certain value more efficiently than if you were to find the value in a Binary Tree or Tree. For example, if the value you want to find is less than the root's data, this means that the node you want to look for is to the left of the root. So you'll want to look at node's left child, and then their children, and so on, until you find the value you're looking for. If you had to look for a value in a Binary Tree or in a Tree, you'd have to check the value of every node within its structure. We also learned about inserting a node into a Binary Search Tree and deleting a node from a Binary Search Tree.

No comments:

Post a Comment