Presentation is loading. Please wait.

Presentation is loading. Please wait.

1Computer Sciences Department. 2 QUICKSORT QUICKSORT TUTORIAL 5.

Similar presentations


Presentation on theme: "1Computer Sciences Department. 2 QUICKSORT QUICKSORT TUTORIAL 5."— Presentation transcript:

1 1Computer Sciences Department

2 2 QUICKSORT QUICKSORT TUTORIAL 5

3 Computer Sciences Department3 OBJECTIVES The divide and conquer approach. Quick sort.  Example of quicksort.  Analysis of quicksort.

4 Computer Sciences Department4 Quicksort

5 5 Procedure implements quicksort

6 Computer Sciences Department6 Partitioning the array

7 Computer Sciences Department7 Exercises Sort the below array by using quicksort : 10619208

8 Computer Sciences Department8 10619208 pivot 10619208 10619208 10619208

9 Computer Sciences Department9 20619108 20619108 20196108 Sorted

10 Computer Sciences Department10 6 8 pivot 6108 6 8 68 Sorted

11 Computer Sciences Department11 68 Sorted 68 86 20191086

12 Computer Sciences Department12 What is the proof of O (n^2)?

13 Computer Sciences Department13

14 Computer Sciences Department14 What is the proof of Omega (n lg n)?

15 Computer Sciences Department15

16 Computer Sciences Department16 Worst case running time :  n^2) Expected running time :  (n lg n). Sorts in place.


Download ppt "1Computer Sciences Department. 2 QUICKSORT QUICKSORT TUTORIAL 5."

Similar presentations


Ads by Google