Monday, 9 March 2015

Week 8 of CSC148



Hi everyone! 

Sorry I’m a little late in posting this week’s entry. This week we were asked to talk about last week’s class. Last week we learned about Binary Trees, Tree Traversals, and Binary Search Trees. 

Binary Tree
A binary tree is a tree with a branching factor of 2, where one child is named left and the other child is named right.

Tree Traversal
Re-visiting nodes of a tree to perform a task at each node. There are specific systematic ways in which we revisit the nodes. These ways are as follows:

  • In-order

  • Pre-order

  • Post-order

Binary Search Trees (BSTs)
A binary tree where all the nodes to the left (i.e. in the left sub-tree) are smaller in value than the node and all the nodes to the right (i.e. in the right sub-tree) are larger in value than the node.  

We also learned to code for special methods in the BTNode class and learned to write the ‘contains’ method. I found week seven’s course material a little intimidating at first. The special methods for BTNode seemed pretty straight forward but the ‘contains’ method stumped me a little at first. However, I reread the code multiple times and drew a couple of pictures with sample test cases in mind that helped me work through the code systematically and helped me understand the ‘contains’ method better. 

Those are all my impressions for week seven and I will write to you all next week. 

Thank you !! 

Sunday, 1 March 2015

Week 7 of CSC148

Hi !!

This week we were asked to write about either recursion or OOP or Abstract Data Types. I would like for you to take a look at my summary of recursion which is linked below:

http://avslogcsc148.blogspot.ca/2015/02/week-5-of-csc148.html



Until next week :).