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.
Tuesday, 29 March 2016
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.
Subscribe to:
Posts (Atom)