Download presentation

Presentation is loading. Please wait.

Published byTyler Thick Modified about 1 year ago

1
Introductory Algorithms Lecture 01: Sorting Algorithms April 8 th, 2009 Jonathan Tse Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up

2
Sort Playing Cards Sorting Order – Sort into Suits Clubs, Diamonds, Hearts, Spades – Sort Suits A J Q K Rules 4/8/092 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Cards In HandCards On Table Sort AloneGroup AGroup B Sort TogetherGroup CGroup D

3
Post-Sort Discussion What was different about how you sorted? Which way was harder/more time consuming? Which way took up more physical space? Was one way clearly better than another? Was one way better in a given situation? 4/8/093 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up

4
Post-Sort Discussion Moving 1 Card == 1 Processor Action Memory Space == Physical Space Tradeoff Between: – Number of Processor Actions – Memory Space Used 4/8/094 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up

5
Insertion Sort 4/8/095 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space 23

6
Insertion Sort 4/8/096 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space 23

7
Insertion Sort 4/8/097 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space 23

8
Insertion Sort 4/8/098 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space 45

9
Insertion Sort 4/8/099 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space

10
Insertion Sort 4/8/0910 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space

11
Insertion Sort 4/8/0911 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space

12
Insertion Sort 4/8/0912 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Done!

13
Selection Sort 4/8/0913 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space

14
Selection Sort 4/8/0914 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space 12

15
Selection Sort 4/8/0915 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space 17

16
Selection Sort 4/8/0916 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space 18

17
Selection Sort 4/8/0917 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space 22

18
Selection Sort 4/8/0918 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space 23

19
Selection Sort 4/8/0919 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space

20
Selection Sort 4/8/0920 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Done!

21
Merge Sort 4/8/0921 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Array Space Working Space

22
Merge Sort 4/8/0922 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Done! Array Space Working Space

23
Radix Sort 4/8/0923 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up Done! Working Space Array Space

24
Summary of Sorting Algorithms Insertion Sort Selection Sort Merge Sort Radix Sort 4/8/0924 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up

25
Wrap-Up Was there anything in particular you noticed about the algorithms? Is one better than the other? In what situation is one better than the other? How do we objectively compare these algorithms? 4/8/0925 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up

26
Wrap Up Is there some comparison metric? Can we quantify memory usage? What about execution time? Does the list to be sorted affect anything? Is there a worst case? 4/8/0926 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up

27
Next Time Standard Metrics for Algorithm Performance Worst Case Analysis 4/8/0927 Overview – Sorting Activity – Post Sort Discussion – Sorting Algorithms – Wrap Up

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google