Sorting has always been a sore sport for me (ha).
Even in CSC148, I had a bit of an issue with sorting, and I had a hard time visualizing it in my head. However, looking at the sorting examples used in class and during the labs, I'm beginning to see how sorting works, even for abstract data structures such as trees. Recursive thinking is essential for sorting through objects that aren't straight forward lists or arrays. If the object contains other object, in order to sort the parent object, the sorting algorithm will have to go through the child objects and sort them relative to and with the parent object.
This leads to the runtime problems. Which sorting algorithm is the best for a certain data structure? Some algorithms go through a linear progression of elapsed time, whereas others may have an exponential time elapsed. I suppose this is why CSC165 is necessary.
No comments:
Post a Comment