The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
Lecture 6 - linear sorting Next: Lecture 7 - elementary Up: No Title Previous: Lecture 5 - quicksort Algorithms Mon Jun 2 09:21:39 EDT 1997 file:///E|/LEC/LECTUR17/NODE6.HTM (7 of 7) [19/1/2003 1:34:38]
Lecture 7 - elementary data structures Next: Lecture 8 - binary Up: No Title Previous: Lecture 6 - linear Lecture 7 - elementary data structures Listen To Part 7-1 8.2-3 Argue that insertion sort is better than Quicksort for sorting checks In the best case, Quicksort takes . Although using median-of-three turns the sorted permutation into the best case, we lose if insertion sort is better on the given data. In insertion sort, the cost of each insertion is the number of items which we have to jump over. In the check example, the expected number of moves per items is small, say c. We win if . Listen To Part 7-2 8.3-1 Why do we analyze the average-case performance of a randomized algorithm, instead of the worst-case? In a randomized algorithm, the worst case is not a matter of the input but only of luck. Thus we want to know what kind of luck to expect. Every input we see is drawn from the uniform distribution. Listen To Part 7-3 8.3-2 How many calls are made to Random in randomized quicksort in the best and worst cases? Each call to random occurs once in each call to partition. The number of partitions is in any run of quicksort!! There is some potential variation depending upon what you do with intervals of size 1 - do you call partition on intervals of size one? However, there is no asymptotic difference between best and worst case. file:///E|/LEC/LECTUR17/NODE7.HTM (1 of 13) [19/1/2003 1:34:41]
- Page 851 and 852: Lecture 1 - analyzing algorithms is
- Page 853 and 854: Lecture 2 - asymptotic notation How
- Page 855 and 856: Lecture 2 - asymptotic notation Not
- Page 857 and 858: Lecture 2 - asymptotic notation alg
- Page 859 and 860: Lecture 2 - asymptotic notation Sup
- Page 861 and 862: Lecture 2 - asymptotic notation Nex
- Page 863 and 864: Lecture 3 - recurrence relations Is
- Page 865 and 866: Lecture 3 - recurrence relations
- Page 867 and 868: Lecture 3 - recurrence relations Li
- Page 869 and 870: Lecture 3 - recurrence relations Su
- Page 871 and 872: Lecture 3 - recurrence relations A
- Page 873 and 874: Lecture 4 - heapsort Note iteration
- Page 875 and 876: Lecture 4 - heapsort The convex hul
- Page 877 and 878: Lecture 4 - heapsort 1. All leaves
- Page 879 and 880: Lecture 4 - heapsort left = 2i righ
- Page 881 and 882: Lecture 4 - heapsort Since this sum
- Page 883 and 884: Lecture 4 - heapsort Selection sort
- Page 885 and 886: Lecture 4 - heapsort Greedy Algorit
- Page 887 and 888: Lecture 5 - quicksort Partitioning
- Page 889 and 890: Lecture 5 - quicksort Listen To Par
- Page 891 and 892: Lecture 5 - quicksort Listen To Par
- Page 893 and 894: Lecture 5 - quicksort The worst cas
- Page 895 and 896: Lecture 5 - quicksort Mon Jun 2 09:
- Page 897 and 898: Lecture 6 - linear sorting Since 2i
- Page 899 and 900: Lecture 6 - linear sorting With uni
- Page 901: Lecture 6 - linear sorting Listen T
- Page 905 and 906: Lecture 7 - elementary data structu
- Page 907 and 908: Lecture 7 - elementary data structu
- Page 909 and 910: Lecture 7 - elementary data structu
- Page 911 and 912: Lecture 7 - elementary data structu
- Page 913 and 914: Lecture 7 - elementary data structu
- Page 915 and 916: Lecture 7 - elementary data structu
- Page 917 and 918: Lecture 8 - binary trees - Joyce Ki
- Page 919 and 920: Lecture 8 - binary trees TREE-MINIM
- Page 921 and 922: Lecture 8 - binary trees Inorder-Tr
- Page 923 and 924: Lecture 8 - binary trees Listen To
- Page 925 and 926: Lecture 8 - binary trees insert(b)
- Page 927 and 928: Lecture 8 - binary trees Not (1) -
- Page 929 and 930: Lecture 9 - catch up Next: Lecture
- Page 931 and 932: Lecture 10 - tree restructuring 1.
- Page 933 and 934: Lecture 10 - tree restructuring Lis
- Page 935 and 936: Lecture 10 - tree restructuring Not
- Page 937 and 938: Lecture 10 - tree restructuring Cas
- Page 939 and 940: Lecture 11 - backtracking Next: Lec
- Page 941 and 942: Lecture 11 - backtracking Only 63 s
- Page 943 and 944: Lecture 11 - backtracking Recursion
- Page 945 and 946: Lecture 11 - backtracking Specifica
- Page 947 and 948: Lecture 12 - introduction to dynami
- Page 949 and 950: Lecture 12 - introduction to dynami
- Page 951 and 952: Lecture 12 - introduction to dynami
Lecture 7 - elementary data structures<br />
Next: Lecture 8 - binary Up: No Title Previous: Lecture 6 - linear<br />
Lecture 7 - elementary data structures<br />
Listen To Part 7-1<br />
8.2-3 Argue that insertion sort is better than Quicksort for sorting checks<br />
In the best case, Quicksort takes . Although using median-of-three turns the sorted permutation into the<br />
best case, we lose if insertion sort is better on the given data.<br />
In insertion sort, the cost of each insertion is the number of items which we have to jump over. In the check<br />
example, the expected number of moves per items is small, say c. We win if .<br />
Listen To Part 7-2<br />
8.3-1 Why do we analyze the average-case performance of a randomized algorithm, instead of the worst-case?<br />
In a randomized algorithm, the worst case is not a matter of the input but only of luck. Thus we want to know what<br />
kind of luck to expect. Every input we see is drawn from the uniform distribution.<br />
Listen To Part 7-3<br />
8.3-2 How many calls are made to Random in randomized quicksort in the best and worst cases?<br />
Each call to random occurs once in each call to partition.<br />
<strong>The</strong> number of partitions is in any run of quicksort!!<br />
<strong>The</strong>re is some potential variation depending upon what you do with intervals of size 1 - do you call partition on<br />
intervals of size one? However, there is no asymptotic difference between best and worst case.<br />
file:///E|/LEC/LECTUR17/NODE7.HTM (1 of 13) [19/1/2003 1:34:41]