Wednesday 2 April 2014

Sorting and Efficiency

This week we have been asked to discuss sorting functions and efficiency of functions. To discuss efficiency we have generalized the run time of algorithms using big-oh notation. The purpose of the big-oh notation is to express functions in the most general form of their behaviour. This ultimately relies on the most significant term in the function, meaning the term with the highest power. This is what we seek to analyze because we are interested in what our algorithms will do on sets of data that are very large. When we get to such large sets of data the terms of the function that are not of the highest power will become minute which leads us to the generalization we do in using big-oh notation.

After working so much with recursion in csc148 we were able to move on to more complex and efficient sorting algorithms than csc108 by using recursion. Two of the recursive sorting algorithms we discussed were merge sort and quick sort. The algorithm that I found most intriguing was quick sort because of its simplicity and I think it really captures the beauty and effectiveness of recursion. Quick sort simply creates two sublists of the list to be sorted. One list is created by taking all of the items that are greater than the item at the first index which will than also be sorted using quick sort and added to the left of the first element in a new list. Similarly the second list is created by taking all of the items that are greater than or equal to the first item which will then be quick sorted and added the end of the new list. This process will continue on each sublist there are only 1 items in the sublist. At this point we know the function has placed this item either to the left or right of the first item of the previous sublist so we know it is appropriate sorted position.

Wednesday 12 March 2014

A future in computer science

I apologize to my dedicated viewers. I realize that lately I've neglected you and I hope I haven't lost your interest. This week I've felt somewhat anxious about the happenings in my computer science courses and also the work load of everything else. Really the only thing that troubled me in 148 specifically this week was the lab. Though I ended figuring everything out, I felt discouraged through the lab, but really I was just thinking about the problem in the wrong way. On the other hand I think I have genuine concerns about by current ability for solving proofs in 165 but that is not the focus of this blog.

Initially I was slightly confused about LinkedLists but I think I have a firm grasp on the concept now, although I don't see how useful they are in comparison to other concepts we've learned this year. Something I am still somewhat confused about is the LinkedLists with a wrapper but I think this is because I've been to busy to take the time to really learn it.

Although I'm having some difficulties in certain respects I've realized that I'd like to focus more on computer science through my university education. I really like the fact that computer science is intellectually challenging but that I'm learning an actual practical skill.

Sunday 2 March 2014

Recursion

This week we've been asked to discuss recursion. This was one of the earliest new concepts we have been introduced to in csc148. Essentially recursion is an efficient way to process information that is built up from small information of the same structure as the whole. In a recursive function we define a base case which is the smallest structure of information the function will process and this is where the actual use of the function takes place. If we have information that can be considered as being made up of a the base structure of information the function will call itself with a reduced version of the initial information (say by one base case). If this reduced version of the original information is still built up of the smallest structure of information the function will then call itself again. This will repeat recursively until all of the information can be processed in terms of the base case.

I have found recursion to be the most compelling and exciting in computer science so far. I sort of stumbled on this notion during last semesters csc108 but could not really make proper use of it. After learning the proper technique of recursive functions in csc148, I've realized how useful this concept really is. In theory, this very simple concept can allow for the processing of information of infinite depth. Although writing recursive functions can be tricky to wrap your mind around at times this incredibly powerful idea can be implemented in Python function is such surprisingly simple way. The power along with the simple form a recursive function can take is really extraordinary.

Sunday 2 February 2014

COMPUTER SCIENCE!

The past two weeks I've found that I have regained my confidence in programming. The instructions for first week's lab I found to be very confusing and my partner was more confused than I was. I also felt I was not as engaged in lecture as I used to be in in CSC108. This made me some what worried for what was to come in 148 however, I am again excited about progressing further with computer science.

The most recent labs I have found to be much clearer in the instructions and I found that my ability in programming was up to the challenges being presented in 148. Additionally I met a friend in the lab who is on par with my programming abilities and we worked well together in the labs.

In terms of lecture, I've realized that the dynamic of the content we are learning is much different than 108. I felt as though lectures were slipping by without having learned anything. I think this was so because in 108 we were being taught fundamental tools for basic programming but now in 148 it's more about details and complexity. Instead of learning new python tools for completing various tasks we are using tools we already know to complete tasks in the most effective way and applying them for more complex task. For example recursion is a new topic that has been introduced in 148. Although this is a more complex concept than what we learned in 108 that can be used to complete higher level problems, it does not use any tools of python that we do not already know. It simply uses loops in a precise why by calling it self while reducing the information on each call.

All together I feel that in reality I have a firm grasp on the concepts that are being discussed and I believe I have a clear understanding of the first assignment.

Saturday 25 January 2014

Object-oriented Programming



Over the past few weeks of computer science we have been focusing on delving deeper into object-oriented programming. Rather than writing functions to preform a specific task, we are creating "objects" that behave in certain ways and have certain properties that can then be used in various tasks. Beginning, I have felt that I am comfortable with the over arching concepts of designing in a object-oriented fashion from what was covered in CSC108 but now it is a matter of a more complex and detailed understand and design.  However, coming from CSC108 this method of approaching programming problems did not seem intuitive at first but, I can see the possibilities of this being much more diverse. Since our code is designed in a sense to create self contained objects, it opens up the ability of implementation code with other programs in a much more effective way. Although I found the challenges in CSC108 to be fairly straight forward I think CSC148 is going to require much more complex solutions along with more critical analysis to create the best possible solutions.