Sorting and Searching homework

05 Oct 2021 - 15:00 | Version 1 |
Due date given in class
To be handed in via hard copy on the date specified

Data set to use for sorting each question

65, 34, 27, 84, 92, 54, 82, 15, 75, 49, 50, 21
  1. Sort via the selection sort. Show your work after each pass through the "outer loop". Include passes that due nothing.
  2. Sort via the insertion sort. Show your work after each pass through the "outer loop". Include passes that due nothing.
  3. Sort via the bubble sort. Show your work after each pass through the "outer loop". Include passes that due nothing.
  4. Sort via the merge sort. Show your work before each merge.
  5. Sort via the heap sort. Show your work after each adjustment of the "heap"
  6. Complete the following chart
  7. If you had to sort data that was so large it could not fit into memory, what sort would you consider modifying? Why? What is the work you are trying to minimize?
Sort name Best Case Description Base Case Work Compares Best Case Work Moves Worst Case Description Worst Case Work Compares Worst Case Work Moves Average Case Work Compares Average Case Work Moves
Selection Sort                
Insertion Sort                
Bubble Sort                
Merge Sort                
Heap Sort                
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine