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.