Sorting and Efficiency
This week, we covered multiple types of sorting, why they are used and how efficient they are compared to the list size
Bubble sort, selection sort, insertion sort, quick sort, merge sort, python's built-in sort and the conditional count sort. Generally, since python's built-in sort is a combination of the other sorts in order to maximize efficiency, it will run the fastest out of all of them. However at very large lists, the simple count sort can run slightly faster than the built-in sort.
The efficiency of the count sort though comes from the assumption that all the values in the list are between 0 and len(list).
Thursday, 27 March 2014
Thursday, 20 March 2014
CSC148 Week of Mar 16
And I completely forgot about this thing last week. Up until I finished the assignment, I hadn't really thought about this slog this week.
The second part of assignment 2 wasn't difficult to program, but it was very long (at least for me). For a couple of the functions, I made helper functions, and then I realized that the last function was basically the exact opposite of one of my helper functions. That made me hopeful about that last function... Unfortunately, the function was a one-way only function, so I had to create a different set of functions for the last one.
The second part of assignment 2 wasn't difficult to program, but it was very long (at least for me). For a couple of the functions, I made helper functions, and then I realized that the last function was basically the exact opposite of one of my helper functions. That made me hopeful about that last function... Unfortunately, the function was a one-way only function, so I had to create a different set of functions for the last one.
Saturday, 8 March 2014
CSC148 Week of Mar 2
First of all, the assignment was extended :D
Our lessons delved further in depth into linked lists- trees with one child and an empty final node to signify the end of the list.We also covered binary search trees, trees that are sorted by the values of their objects, making searches quicker and more efficient.
And lastly I should really stop procrastinating on the slogs and assignments (back to finishing the assignment).
Our lessons delved further in depth into linked lists- trees with one child and an empty final node to signify the end of the list.We also covered binary search trees, trees that are sorted by the values of their objects, making searches quicker and more efficient.
And lastly I should really stop procrastinating on the slogs and assignments (back to finishing the assignment).
Subscribe to:
Posts (Atom)