Wednesday, 20 April 2016
Week 12
This week we looked at hash tables. From what I understand, hashing is when you utilize an algorithm to store an element in memory as to access it in an efficient way later. It makes a map to the value you are looking for. It reduces the worst case of searching for a value from linear to constant. That is it is independent of the number of items in the array. The algorithms assigns a key value to each value in order to access it later. It runs into trouble if two values are assigned the same key values. This is called a collision. To avoid collisions the algorithm attempts to spread out the key value.
Week 10
This week we looked at algorithm efficiency. This is very much like what we learned in 165 but without the proof. It's interesting to think of the huge efficiency discrepancies between algorithms. A simple loop will increase your run time by n times. Another thing I found interesting was the possibility of an average run time case. It's interesting to think of functions that have the same worst case run time but different average run time cases. This leads to specialized algorithms which are faster in different situations. I now understand why it is important to look at run times of a function.
Tuesday, 19 April 2016
Week 9
This was the week of the second midterm. I found the midterm very fair. I forgot the error checking for linked lists on the first question. I forgot to check for cases such as if the node your swapping is the last node. I feel more comfortable with recursion after studying the past midterms. Hopefully I'll my mark reflects the effort I put into this test.
Week 8
This week we looking at binary trees with greater depth. What I found very interesting was the different orders of traversal. Pre-order visit is when you visit each left sub-tree before visiting the right. Post-order visit is when you visit each node after you visit it's subtrees. Level-order visit is when you visit the nodes at each level of subtree before moving onto the next. These methods can be used for different types of data manipulation in different circumstances. When searching for a node it might be more efficient to use level-order search if the node is likely to be one of the first few nodes.
Monday, 18 April 2016
Week 6
This week we started looking at recursion. I've seen recursion before but hopefully we will look at it with greater depth. I was interested in seeing recursion implemented with list comprehension. I find it a clear and concise way of dealing with a recursive problem. Recursion is useful in many situations such as implementations of powers and multiplication. It can be used when a problem is best solved by repeating a process on each extension of the problem.
Week 5
This week we completed the midterm. I thought the midterm was fair but the questions were a little vague. I was not confident that I answered the questions as they were meant to be answered. I felt comfortable with the material although I was expected a question on linked lists. I spent most of my time studying the implementation and applications of linked lists. I was worried I wouldn't finish.
Subscribe to:
Posts (Atom)