Wednesday, 12 February 2014

Assignment 1

    Okay, I think I have finally devised an algorithm for solving assignment (which is not a fast guess algorithm by the way). I just thought using a brute force guessing algorithm would be make this assignment too easy. Besides, I love math, so I decided why not try to create an actual algorithm to solving the problem. It took me a huge amount of time experimenting with numbers. I'm not actually sure if it is any faster than just guessing numbers, but it sure was fun to figure out how to do it. I'm just trying to figure out how to optimize my algorithm even further. I would love to post my algorithm here, but then you guys don't get to indulge yourself within the awesomeness of trying to figure it out yourself.

    I really love this assignment. This is the first assignment that was fun, challenging and not tedious at the same time. Squeal assignment was fun too, but it became more of a chore after a while when it came to fixing the code. This assignment is more thinking and less coding, which is the type of assignments I enjoy doing. 

    Keep these awesome assignments coming Dan.

Saturday, 8 February 2014

Recursions

    Assignment 1's due date is fast approaching. I looked at what we have to do for
assignment 1 and started out with thinking what to do for the automated part. It turned
out to be easier than I expected, however if you are worried about it, I suggest to get
a head start on it as soon as possible, as it does take a fair amount of thinking to
solve the last part.

    Overall, my thoughts on recursion are that it is definitely a difficult topic to
understand for several reasons. It is difficult to think of a solution in a way that it
is composed to several smaller, easier solutions to a big problem instead of just
thinking of a solution which solves a problem entirely in one instance. I was a bit
disappointed that there weren't any exercises for recursion, but the in-class problems
helped a ton.

Sunday, 26 January 2014

         Okay, first blog for CSC148. The abstract data types lab has been an interesting one. A really interesting thing that we discovered was that inserting at the beginning of the list is faster than popping elements at the beginning of the list. Not even marginally faster, but significantly. Eventually, instead of popping or inserting elements at the beginning, we just kept a counter which kept track of the current index of the next element to be de-queued and incremented it as the elements were de-queued. Then, we just added an occassional cleanup routine to the queue so that it wouldn't become too big. This resulted in our queue being faster than the python built-in queue up to a trillion elements (good thing I had a fast PC to do that).

        Anyways, soon we will be covering recursions. During last semester, when we covered sorting algorithms, I started researching some sorting algorithms on my own and discovered quicksort. It's a sorting algorithm that uses recursive calls, yet it is generally still faster than other popular sorting algorithms (such as mergesort and heapsort). It would be awesome if we could cover quicksort as an example during the recursions unit.

       Well, that was it for this week. Next update coming up soon.