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.
Tuesday, 29 March 2016
Week 11
Over the course of the year I have gained a deeper understanding of the data types and structures at the heart of any programming language. For example when we discussed linked lists in week 4, it helped me understand how a computer organizes data. Linked lists connect data nodes with a path to the next node. Instead of setting a block of memory for the list, linked lists add blocks of memory as needed. It's a clever way of structuring a list. It can be used in many other data types. It makes for easy access of items by way of traversal through the list.
Looking back now I realize the impact of linked lists on memory organization. Given the context of algorithm efficiency and big-oh notation we discussed in class, I see now how important it is to organize data efficiently. Connected nodes is more efficient than using a long continuous block of memory. Given a large set of data it would be slow to process the entire thing every time the list is called.
There are also some inefficiencies involved with linked lists. For example if you were to access ta later item in the list you would need to traverse the whole list. This could be solved by initializing a variable for the back of the list and path to its previous nodes. Although this requires more memory it makes traversal more efficient.
When developing data types it's important to keep efficiency in mind. Having efficient data types at the heart of your algorithms insures an efficient solution.
Looking back now I realize the impact of linked lists on memory organization. Given the context of algorithm efficiency and big-oh notation we discussed in class, I see now how important it is to organize data efficiently. Connected nodes is more efficient than using a long continuous block of memory. Given a large set of data it would be slow to process the entire thing every time the list is called.
There are also some inefficiencies involved with linked lists. For example if you were to access ta later item in the list you would need to traverse the whole list. This could be solved by initializing a variable for the back of the list and path to its previous nodes. Although this requires more memory it makes traversal more efficient.
When developing data types it's important to keep efficiency in mind. Having efficient data types at the heart of your algorithms insures an efficient solution.
Friday, 4 March 2016
Week 7
This past week we have worked on recursion and recursive methods. Recursion is a powerful tool that repeats a solution to a smaller problem to solve a bigger problem. Doing recursion beforehand has helped me understand the examples in class. Thinking of a recursive problem as a tree makes the problem solving process clearer. Once you find the base case you repeat the process until you reach a leaf. I like coming up with different solutions for the examples we did in class.Although recursion is tough to understand I believe it will be a powerful tool in my future of problem solving.
Wednesday, 3 February 2016
Week 4
Learning about linked list helped me understand data types better and how python organizes memory and data. Representing data in a collection is very useful for processing it. Instead of using a long continuous block of memory we use linked lists to connect data to each other. Setting an element of a collection to refer to the next element will recursively call the rest of the collection when the element is called. It will be interesting to see how we would modify the collection using methods such as sort. We will need to change the references of each element. Learning about data types help me understand the fundamentals of how computers handle data.
Tuesday, 26 January 2016
Slog 1
So far the course has provided me with a more structured outlook of programming. I've learned to implement classes and methods in a more clear and meaningful way. I've learned to design classes with other programmers in mind. When designing classes we need to think of how others will use them. When we create classes for other people we need to convey the attributes and abilities of the class clearly. For example, adding an underscore to variables that we don't want accessed. We also created a superclass in order to reduce the amount of duplicate code. This reduces the complexity of the code. Thinking about how another person might interpret what you're saying forces you to communicate clearly and meaningfully.
I am excited to use the blogging format as part of my programming experience. It will help me communicate my ideas in different ways. It my also help me with working through a problem by looking at it in a different way.
Subscribe to:
Posts (Atom)