Thursday, March 31, 2016

Lecture11


He had explained about efficiency of algorithm with a graph of growth rates of functions: n, log n, n log n, n^2, 2^n and n!. This is continue of the last week. Depending on function. Measuring efficiency of algorithm with a stop watch is not realistic. It should be calculated. The order of big rule is important to compare the growth of functions; find a dominant term in a notation. If rank of Big_O is same for notations, the notations are in same order.  The idea of big_O has been seen in CSC165 and similar one in MAT137.
Calculation of Time Complexity is done in CSC165 as well, but different. Thinking about worst case of function especially on loop to count the number of comparisons is an idea of this.  Big_O is what should be considered to find it.


Wednesday, March 30, 2016

Lecture 9

Continue from last week.

The lecture is about Binary Search Tree. Bst_del_rec is a function that deletes a node of tree and return the changed tree. There are 4 recursive cases and one base case in the function. It is BST, so left value is always less than the tree’s value and right value is larger than the tree’s value. This is used in the method to find the largest value of tree and recursive cases. Efficiency of algorithm is new in this class, CSC148. It considers about iteration vs. recursion, and extra memory. 

Thursday, March 10, 2016

Lecture 8

The lecture had begun with an explanation of the test 2. It would be about linked list, recursion, and trees which we worked on this lecture8 and the last lecture. Binary Trees consist three parameters: data of a node, left child, and right child. The child could be Binary Tree. If trees are equal, this means that all nodes, subtrees, should be same as well. __eq__ of self and other of Binary Tree was explained, and __eq__ is a special method and is a recursive definition. __str__ is a method to show a tree in a readable way. Contains is a project to check whether a value is contained in a tree with recursion. Evaluates is a project to calculate a result of the tree when a root/s in the Arithmetic Expression. BST is another type of tree to organize data. Until here is what will be on the test 2.  

Lecture 7

Our lecture had begun with more on recursive functions. He explained about recursive function, max_list with the function that we saw in last week. Last week, we only discussed what recursive function of list. Now, we learn recursive functions that do not use a list as a parameter.  Fibonacci function and Factorial function are new examples of recursive functions. We practiced how the functions works. For example, Fibonacci(5) = 8 with steps of what Fibonacci of less than 5 would be. Then, we viewed another example, Balanced Strings. He explained about its base case and recursive cases with situations when they would achieve condition. Next, he showed how to trace function of Stack of activation records, which shows which line number and function are used, and what happens on a parameter of the function.
Moreover, he explained why recursive function is important. No recursive function is more efficient than its iterative equivalent for problems that are naturally recursive.
Class tree is discussed. There are several functions, called height, paths, leaves, count, and others in the tree. These functions can be written by recursive.

Writing recursive function is new and tracing the recursive functions with Stack step is difficult. 

Wednesday, March 2, 2016

Sixth week

First, professor has explained about the first test. Its class average was about 68%.
Them, he has talked about recursion. Our goal for today is tracing recursive function. Recursive function is what a function contains the function like a sequence. He showed its example, sum of a list, and how does the function works with a process of operation. Then we solved examples of sum of list and depth of list functions with a process. There is at least one base case and least one recursive case in recursive function. Generally False part is a base case. For the depth, there are 2 base cases and 1 recursive case.
Recursion function is for our convenience

We need to bring some papers ourselves to answer questions from next week. 

Wednesday, February 24, 2016

Fifth Week

On the day of the lecture5, we had a test. I spent more time than what I expected.

Then, on the lecture, the professor began with a review of stack. The main topic of the lecture was Linked Lists. In comparison between regular list, Linked list is a way to reference to the list efficiently. There are nodes in linked lists that contain data as a next one. Helper was shown for LinkedListNode Class for nodes. 

Saturday, February 6, 2016

Fourth Week

From lecture 4, we have begun with an explanation of the test on next week. Then, we reviewed contents from the last week and what would be on the lecture. Stacks and Sack are topics that we have done in lecture 4. Professor discussed about daily uses of stacks and Sack with definitions of them. Then what should be implemented in superclass, Container is discussed. He showed a sample, but taught that we create the own program in other ways. Design recipe for the class was showed, and this is important for writing any classes and review from last lectures and CSC108.  Uses of special classes is also discussed. How and when could we use them is taught. Unittest is new thing in the course. This is important as well. It is used to test cases of other classes. Parenthesization is an error in a program for example [ab}.  

Wednesday, January 27, 2016

Third Week

The lecture was begun with a review of last lectures. Thus, I reviewed how class work in python, and recipe to write class. An example of class that I learned is Shape with Squares and RightAngleTriangle. I am confusing about what property() means in Shape, and a movement of the shapes that professor showed us in the lecture.

Type contrast is a way different from what I learned in 108. Also, @param is a new way of the type contrast. I am not done tutorial yet, so I have not done a quiz and a lab in this week.

Next week, I will learn class more with an example of class, stack.