Sunday, 28 February 2016

Week 4

     After last week's inheritance, and subclass, we learned about abstract data type - stack and container, unit test, balanced parentheses and linked list.
     Stacks and containers are just abstract data types that can store values and new items are added on top of the stack, and you can only remove items from the top of the stack. Also there's a method which tells me whether the stack is empty or not.
     I personally find unit test to be the most challenging part of this week's materials. Apparently unit test is a framework that setup test cases, and run them independently. An example of unit test can be used on balancing parentheses. The solution to this unit test is that we create an empty list, which if see a "(", add to s. If see a ")" remove from s, and if at the end the list is empty, then it's true.
     The next part of this weeks lecture is linked list. It is like a list, but the nodes inside the list are linked with the previous and the next node. Linked lists have a head and tail, which are the first and last node in the linked list. and each node have a node linked to node.next.

No comments:

Post a Comment