Thursday, April 3, 2014

Week 12 - Exam Review

Like last week, there wasn't any immediate new information being taught. Again, we just went through some standard "big o" and tracing problems. One really cool thing I found interesting was being able to modify the recursion limit of a function using "sys" and the "getrecrusionlimit()" method. We also went through some new methods to solve the Fibonacci number function, but I guess that went over everyone's head because of exams coming up. Other than that, the week was pretty much just basic review.

Week 11 - Test Review

This week didn't have any new material. We basically had a review session for the test coming up. Regarding the test, I believe that it could have gotten a better mark, but regarding the circumstances, it could have gotten worse. The basic concepts for review were basically recursive functions involving trees. It can get pretty tricky when dealing with classes and methods, but I guess practice makes perfect.

Monday, March 24, 2014

Week 10 - Sorting

Last semester, we earned about different types of sorting techniques, but we never actually understood how Python executed these internally. However, understanding different algorithms such as the Quicksort and the Merge Sort will give us a broader understanding of how these algorithms work. An interesting way on how the Quicksort method works is that it requires a helper function in order to partition the input given. The overall algorithm also sorts the input recursively allowing the efficiency of the code to take log(n) steps in most cases.

Week 9 - Complexity

This week had an emphasis on understanding and writing efficient code. The week consisted of writing and comparing different types of algorithms that achieved the same goal, but either had a harder or easier time doing it. Looking at the efficiency of these algorithms mathematically involved us looking at something called a "step". A "step" is something the program can do in a fixed amount of time. The amount of "steps" the program takes is directly related to the length of the input given. Like last semester, looking at the algorithm and determining whether it is a linear, quadratic, cubic, ect. is important to understand the efficiency of the algorithm.

Saturday, March 8, 2014

Week 8 - Binary Search Trees

This week was more of a extension of what we learned on trees. The difference here is that BST's are trees with conditions. Discussed in class, these conditions are used so that we can efficiently search through information quickly.
Some of these methods that include finding a particular element in the BST involve some recursion.
Overall, it was a pretty interesting topic to learn, and it looks like its gonna be very important concept to understand in the coming years.

Wednesday, February 26, 2014

Week 7 - Linked Lists

So after a much needed "break" from school, this week we learned about Linked Lists. These are essentially Trees with a branching factor of 1. The reason for this datatype is so that we may decrease the amount of time an operation takes in a function given its parameter. In our labs, we're just getting familiar with linked lists so that in the future, we can see how linked lists can be used a lot more efficiently compared to nested lists. Dan showed that the linear growth of a list takes a long time to operate on, and that linked lists are used to speed that up.

Friday, February 14, 2014

Week 6 - Trees

This week, we learned about a new type of data structure called Trees. This method of organizing data is used when the data you have is not in a linear structure (For example: Stacks, Lists, Queues, ect.).
With Trees, its not always obvious to organize things in a linear manner, instead, the idea of hierarchy is used to organize the data.

The basis of a tree structure consists of Nodes and Edges. Nodes can be thought of as a "point" in a tree (like the seed, or leaves), while Edges "connect" these Nodes together (much like branches). The main methods used for a Tree structure are traversing through, inserting/removing nodes, and inserting/removing subtrees at a Node.

Overall, the terminology and the overall concept of tree's aren't that hard to understand. Hopefully understanding the code will be just as easy.

Sunday, February 9, 2014

Week 5 - Recursions (again)

This week was very similar to the last, we pretty much only went through a few examples on recursive functions. All my thoughts can be found in the Week 4 post.

Saturday, February 1, 2014

Week 3 - Exceptions

Unfortunately I underwent a surgery this week and was unable to attend the entire week. However, that didn't stop me from reading through the slides and pages on exceptions...
The concept of "catching" errors and dealing with them is something I thought of last semester in CSC108 where I would think of all the possible cases for a function. I would create a function that would require a certain argument, but I would design the function so that the argument must have a special case to it (ie. a list with n length that must have the int 3..a special case like that.), I would then make the function return a string stating that the argument isn't "correct" (ie. "This list doesn't have the int 3"). I would think of things like this and thought why there isn't a built in way of doing this with python.

Luckily there was a built in way to catch these "mistakes" through the use of user defined exceptions. The concept is very similar to what I had in mind originally except its a more "official" way of doing it. E2 was assigned to test your abilities with using and understanding exceptions, and fortunately I was able to complete the exercise with little struggle...I'm sure everyone else in the course did too, but its just that I feel a lot more rewarded when I essentially learned the concept of exceptions on my own.

Wednesday, January 29, 2014

Week 4 - Recursion

As much as I disliked MAT102, concepts such as induction were shown to be a lot easier in CSC148 for me. I feel that learning induction and the concept of recursion should have been taught first in CSC148 because it paints a clearer picture as appose to learning it the "hard" way (like MAT102...). Its interesting to see how creative these pieces of code can get, especially when the code works in a way that completes a task in a way CSC rookies won't understand right away. I'm looking forward to how creative and complex assignments and concepts are gonna get in the coming years in CSC....

Examples of recursive statements are algorithms or a series of computations that rely on previous information. You start out with a base case that HAS to work, and you assume that condition holds for the next case, and so on. A common mathematical example of this would be Fibonacci's Sequence. The sequence of numbers rely on the numbers that come before it. I've had some difficulties understanding this in MAT102, I'm not sure why...But going through the first function we did this week (the binary bit function), I fully understood the concept of recursion and induction. Now its just a matter of thinking recursively when it comes to different problems.