Sunday, 23 March 2014

Week 10: Sort of an Assignment Week

With the week of regular expressions coming to a close, assignment two ignited sparks in our recursive mindsets as we were given the sample code and were required to complete various methods involving regular expression trees. Most of these functions we were required to complete we were able to solve using our toolkits packed with knowledge involving recursion and linked tree lists that we have been constantly adding under out belts as programmers. During the lectures we were introduced to the topic of sorting algorithms, the basics involving their steps, run-times as well as the many perks and flaws among them. Many sorting algorithms involving various steps which may run differently on different computers which have different quantities of memory. This week we were introduced to an effective notation to dictate the general run-time on all machines such that the run-time would be relative to the number of elements n rather than the amount of cores, memory and RAM your machine has. This notation is called big O notation and by learning this notation, we are able to accurately predict the average changes in run-time when changing the amount of elements when sorting using various algorithms.

Sunday, 16 March 2014

Week 9: Just a Bit of Binary

This week in both the lectures and the lab I attended we were taught the concept of run times as well as binary search trees. A traversal of a tree is when you express a tree in terms of a sort of list, where there are many types such as pre-order and in-order traversals. These traversals are each unique in that independently they do not tell us that much information but for example with both a pre-order traversal and in-order traversal, we are able to accurately replicate the binary tree of the traversals. I had trouble grasping the idea of how the pre-order and in-order traversal incorporated together to create the binary search tree, but adhering to the advice on Exercise and practicing on various trees of different degrees of size and cases, I was able to find out a base case and ultimately solve the problem of recursively creating the binary tree from the pre-order and in-order traversals. We also briefly covered run time in terms of big O notation, this means that the run time is relative and can be compared to different machines that may run at different speeds relative to others as we only take the highest exponent which has to greatest impact on the runtime.

Sunday, 9 March 2014

Week 8: Second Time's the Charm

This week was mostly spent on the concept of trees using lists and linked lists. Linked lists are lists which have two components to them; the value, as well as the remaining list. These lists are useful as we are able to create them and use recursion to greatly reduce the amount of code needed and create unique data structures such as trees. This knowledge was helpful during our second assignment as knowledge of linked lists and trees were essential to completing the assignment about regular expressions in python. Through many struggles I had during the assignment as I was unsure of what the assignment was looking for in it's description, I was able to arrive at an end product that I was proud of and believed to fit the criteria for the assignment. Course resources such as the annotated slides, python code examples as well as the discussion board Piazza was very helpful as many individuals such as myself had difficulties grasping the criteria for the assignment.

Sunday, 2 March 2014

Week 7: Recursion

What is recursion exactly? That's a question that I most definitely had going into this course. Through the course of high school computer sciences courses, you graze lightly upon the topic of recursion and the idea and concept of how it all works never really sinks in. In these past few weeks my basic foundation of knowledge and understanding of recursion has improved significantly. Recursion is a technique used for many applications in programming and can greatly shorten the amount of code that is written. Although the code may be shorter, the method of recursion is not necessarily always the most efficient method. Recursion occurs when you attempt to break a large problem into sub-problems and use the results of these sub-problems in order to achieve the result of the large problem. The problem that most people struggle with is finding the base case, which is the simplest sub-problem which we can easily calculate the result for. By working from the base case and solving larger problems until we are able to solve the entire problem, we can figure out a solution solely knowing the algorithm in python and the base case. I had a great amount of trouble learning and adapting to recursion, but through the many examples and questions we obtained in our lectures and labs, I was able to effectively and thoroughly grasp recursion and put it on many applications such as our assignments and test.