Sorting Techniques
Represent by
SUMAN BANERJEE
23-Mar-17 1
The Quick Sort
23-Mar-17 2
Quicksort
To sort a[left...right]:
1. if left < right:
1.1. Partition a[left...right] such that:
all a[left...p-1] are less than a[p], and
all a[p+1...right] are >= a[p]
1.2. Quicksort a[left...p-1]
1.3. Quicksort a[p+1...right]
2. Terminate
23-Mar-17 3
Partitioning
A key step in the Quicksort algorithm is
partitioning the array
We choose some (any) number p in the
array to use as a pivot
We partition the array into three parts:
p
numbers p numbers greater than
less than p or equal to p
23-Mar-17 4
Partitioning
Choose an array value (say, the first) to use
as the pivot
Starting from the left end, find the first
element that is greater than or equal to the
pivot
Searching backward from the right end, find
the first element that is less than the pivot
Interchange (swap) these two elements
Repeat, searching from where we left off, until
done
23-Mar-17 5
Partitioning
To partition a[left...right]:
1. Set pivot = a[left], l = left + 1, r = right;
2. while l < r, do
2.1. while l < right & a[l] < pivot , set l = l + 1
2.2. while r > left & a[r] >= pivot , set r = r - 1
2.3. if l < r, swap a[l] and a[r]
3. Set a[left] = a[r], a[r] = pivot
4. Terminate
23-Mar-17 6
Example of partitioning
choose pivot: 4 3 6 9 2 4 3 1 2 1 8 9 3 5 6
search: 4 3 6 9 2 4 3 1 2 1 8 9 3 5 6
swap: 4 3 3 9 2 4 3 1 2 1 8 9 6 5 6
search: 4 3 3 9 2 4 3 1 2 1 8 9 6 5 6
swap: 4 3 3 1 2 4 3 1 2 9 8 9 6 5 6
search: 4 3 3 1 2 4 3 1 2 9 8 9 6 5 6
swap: 4 3 3 1 2 2 3 1 4 9 8 9 6 5 6
search: 4 3 3 1 2 2 3 1 4 9 8 9 6 5 6
(left > right)
swap with pivot: 133122344989656
23-Mar-17 7
The partition method (C/C++)
int partition(int a[], int left, int right) {
int p = a[left];
int l = left + 1;
int r = right;
while (l < r) {
while (l <= right && a[l] <= p)
l++;
while (r > left && a[r] >= p)
r--;
if (l < r) {
int temp = a[l];
a[l] = a[r];
a[r] = temp;
}
}
a[left] = a[r];
a[r] = p;
return r;
23-Mar-17 8
}
The quicksort method (in C/C++)
void quicksort(int array[], int left, int right) {
if (left < right) {
if (left == right - 1) {
if (array[left] > array[right]) {
int temp = array[left];
array[left] = array[right];
array[right] = temp;
}
}
else {
int p = partition(array, left, right);
quicksort(array, left, p - 1);
quicksort(array, p + 1, right);
}
}
} 23-Mar-17 9
Analysis of quicksort—best case
Suppose each partition operation divides the
array almost exactly in half
Then the depth of the recursion in log2n
Because that’s how many times we can halve n
However, there are many recursions!
How can we figure this out?
We note that
Each partition is linear over its subarray
All the partitions at one level cover the array
23-Mar-17 10
Partitioning at various levels
23-Mar-17 11
Best case II
We cut the array size in half each time
So the depth of the recursion in log2n
At each level of the recursion, all the partitions
at that level do work that is linear in n
O(log2n) * O(n) = O(n log2n)
Hence in the average case, quicksort has time
complexity O(n log2n)
What about the worst case?
23-Mar-17 12
Worst case
In the worst case, partitioning always divides the
size n array into these three parts:
A length one part, containing the pivot itself
A length zero part, and
A length n-1 part, containing everything else
We don’t recur on the zero-length part
Recurring on the length n-1 part requires (in the
worst case) recurring to depth n-1
23-Mar-17 13
Worst case partitioning
23-Mar-17 14
Worst case for quicksort
In the worst case, recursion may be n levels deep
(for an array of size n)
But the partitioning work done at each level is
still n
O(n) * O(n) = O(n2)
So worst case for Quicksort is O(n2)
When does this happen?
There are many arrangements that could make this
happen
Here are two common cases:
When the array is already sorted
When the array is inversely sorted
23-Mar-17(sorted in the 15
opposite order)
Typical case for quicksort
If the array is sorted to begin with, Quicksort
is terrible: O(n2)
It is possible to construct other bad cases
However, Quicksort is usually O(n log2n)
The constants are so good that Quicksort is
generally the fastest algorithm known
Most real-world sorting is done by Quicksort
23-Mar-17 16
Final comments
Quicksort is the fastest known sorting algorithm
For optimum efficiency, the pivot must be chosen
carefully
“Median of three” is a good technique for
choosing the pivot
However, no matter what you do, there will be
some cases where Quicksort runs in O(n2) time
23-Mar-17 17
Mergesort
Merge Sort
Apply divide-and-conquer to sorting problem
Problem: Given n elements, sort elements into non-
decreasing order
Divide-and-Conquer:
If n=1 terminate (every one-element list is already
sorted)
If n>1, partition elements into two sub-collections; sort
each; combine into a single sorted list
How do we partition?
23-Mar-17 19
The Process
Divide the unsorted array into 2 halves until
the sub-arrays only contain one element
Merge the sub-problem solutions together:
Compare the sub-array’s first elements
Remove the smallest element and put it into
the result array
Continue the process until all elements have
been put into the result array
23-Mar-17 20
Mergesort: Illustration
85 24 63 45 17 31 96 50
23-Mar-17 21
Mergesort: Illustration
85 24 63 45 17 31 96 50
23-Mar-17 22
Mergesort: Illustration
17 31 96 50
85 24 63 45
23-Mar-17 23
Mergesort: Illustration
17 31 96 50
63 45
85 24
23-Mar-17 24
Mergesort: Illustration
17 31 96 50
63 45
85 24
23-Mar-17 25
Mergesort: Illustration
17 31 96 50
24 63 45
85
23-Mar-17 26
Mergesort: Illustration
17 31 96 50
24 63 45
85
23-Mar-17 27
Mergesort: Illustration
17 31 96 50
24 85 63 45
23-Mar-17 28
Mergesort: Illustration
17 31 96 50
24 85 63 45
23-Mar-17 29
Mergesort: Illustration
17 31 96 50
24 85 63 45
23-Mar-17 30
Mergesort: Illustration
17 31 96 50
24 85
63 45
23-Mar-17 31
Mergesort: Illustration
17 31 96 50
24 85
63 45
23-Mar-17 32
Mergesort: Illustration
17 31 96 50
24 85 45
63
23-Mar-17 33
Mergesort: Illustration
17 31 96 50
24 85 45
63
23-Mar-17 34
Mergesort: Illustration
17 31 96 50
24 85 45 63
23-Mar-17 35
Mergesort: Illustration
17 31 96 50
24 85 45 63
23-Mar-17 36
Mergesort: Illustration
17 31 96 50
24 85 45 63
23-Mar-17 37
Mergesort: Illustration
17 31 96 50
24 85 45 63
23-Mar-17 38
Mergesort: Illustration
24 17 31 96 50
85 45 63
23-Mar-17 39
Mergesort: Illustration
24 17 31 96 50
85 45 63
23-Mar-17 40
Mergesort: Illustration
24 45 17 31 96 50
85 63
23-Mar-17 41
Mergesort: Illustration
24 45 17 31 96 50
85 63
23-Mar-17 42
Mergesort: Illustration
24 45 63 17 31 96 50
85
23-Mar-17 43
Mergesort: Illustration
24 45 63 17 31 96 50
85
23-Mar-17 44
Mergesort: Illustration
24 45 63 85 17 31 96 50
23-Mar-17 45
Mergesort: Illustration
24 45 63 85 17 31 96 50
23-Mar-17 46
Mergesort: Illustration
24 45 63 85 17 31 96 50
23-Mar-17 47
Mergesort: Illustration
24 45 63 85
17 31 96 50
23-Mar-17 48
Mergesort: Illustration
24 45 63 85
96 50
17 31
23-Mar-17 49
Mergesort: Illustration
24 45 63 85
96 50
17 31
23-Mar-17 50
Mergesort: Illustration
24 45 63 85
17 96 50
31
23-Mar-17 51
Mergesort: Illustration
24 45 63 85
17 96 50
31
23-Mar-17 52
Mergesort: Illustration
24 45 63 85
17 31 96 50
23-Mar-17 53
Mergesort: Illustration
24 45 63 85
17 31 96 50
23-Mar-17 54
Mergesort: Illustration
24 45 63 85
17 31 96 50
23-Mar-17 55
Mergesort: Illustration
24 45 63 85
17 31
96 50
23-Mar-17 56
Mergesort: Illustration
24 45 63 85
17 31
96 50
23-Mar-17 57
Mergesort: Illustration
24 45 63 85
17 31 50
96
23-Mar-17 58
Mergesort: Illustration
24 45 63 85
17 31 50
96
23-Mar-17 59
Mergesort: Illustration
24 45 63 85
17 31 50 96
23-Mar-17 60
Mergesort: Illustration
24 45 63 85
17 31 50 96
23-Mar-17 61
Mergesort: Illustration
24 45 63 85
17 31 50 96
23-Mar-17 62
Mergesort: Illustration
24 45 63 85
17 31 50 96
23-Mar-17 63
Mergesort: Illustration
24 45 63 85 17
31 50 96
23-Mar-17 64
Mergesort: Illustration
24 45 63 85 17
31 50 96
23-Mar-17 65
Mergesort: Illustration
24 45 63 85 17 31
50 96
23-Mar-17 66
Mergesort: Illustration
24 45 63 85 17 31
50 96
23-Mar-17 67
Mergesort: Illustration
24 45 63 85 17 31 50 96
23-Mar-17 68
Mergesort: Illustration
24 45 63 85 17 31 50 96
23-Mar-17 69
Mergesort: Illustration
24 45 63 85 17 31 50 96
23-Mar-17 70
Mergesort: Illustration
24 45 63 85 17 31 50 96
23-Mar-17 71
Mergesort: Illustration
17
24 45 63 85 31 50 96
23-Mar-17 72
Mergesort: Illustration
17
24 45 63 85 31 50 96
23-Mar-17 73
Mergesort: Illustration
17 24
45 63 85 31 50 96
23-Mar-17 74
Mergesort: Illustration
17 24
45 63 85 31 50 96
23-Mar-17 75
Mergesort: Illustration
17 24 31
45 63 85 50 96
23-Mar-17 76
Mergesort: Illustration
17 24 31
45 63 85 50 96
23-Mar-17 77
Mergesort: Illustration
17 24 31 45
63 85 50 96
23-Mar-17 78
Mergesort: Illustration
17 24 31 45
63 85 50 96
23-Mar-17 79
Mergesort: Illustration
17 24 31 45 50
63 85 96
23-Mar-17 80
Mergesort: Illustration
17 24 31 45 50
63 85 96
23-Mar-17 81
Mergesort: Illustration
17 24 31 45 50 63
85 96
23-Mar-17 82
Mergesort: Illustration
17 24 31 45 50 63
85 96
23-Mar-17 83
Mergesort: Illustration
17 24 31 45 50 63 85
96
23-Mar-17 84
Mergesort: Illustration
17 24 31 45 50 63 85
96
23-Mar-17 85
Mergesort: Illustration
17 24 31 45 50 63 85 96
23-Mar-17 86
Mergesort: Illustration
17 24 31 45 50 63 85 96
23-Mar-17 87
Mergesort: Illustration
17 24 31 45 50 63 85 96
23-Mar-17 88
Mergesort: Time complexity
Best, worst, average-case
Each merge operation takes 0(k) time for 2 lists each
k/2 elements long (merged into one list k elements
long)
There will be log2n levels
1st level: 2 n/2 long lists to be merged into 1 n long
list
2nd level: 4 n/4 long lists to be merged into 2 n/2 long
lists
3rd level: 8 n/8 long lists to be merged into 4 n/4 long
lists
…
Time Complexity: O(nlog2n)
23-Mar-17 89
Method mergeSort()
void mergeSort(int a [], int left, int right)
{
// sort a[left:right]
if (left < right)
{// at least two elements
int mid = (left+right)/2; //midpoint
mergeSort(a, left, mid);
mergeSort(a, mid + 1, right);
merge(a, b, left, mid, right); //merge from a to b
copy(b, a, left, right); //copy result back to a
}
}
23-Mar-17 90
void merge (int a[], int b [], int left, int mid, int right) {
int i, j, k = 0;
for (i = left, j = mid + 1; i <= mid && j <= right;) {
if (a [i] < a [j]) {
b [k] = a [i];
i++;
k++;
}
else {
b [k] = a [j];
j++;
k++;
}
}
for (; i <= mid; i++)
b [k++] = a [i];
for (; j <= right; j++)
b [k++] = a [j];
}
23-Mar-17 91
void copy (int b [], int a [], int left, int right) {
for (int i = 0, j = left; i <= right - left; ++i, j++)
a [j] = b [i];
}
23-Mar-17 92
Bucket Sort
Given that, we have N integers in the range 0 to M-
1
Maintain an array count of size M, which is
initialized to zero. Thus, count has M cells
(buckets).
Read Ai
Increment count[Ai] by 1
After all the input array is read, scan the count
array, printing out a representation of sorted list.
23-Mar-17 93
Radix Sort
Radix sort is generalization of bucket sort.
It uses several passes of bucket sort
Perform the bucket sorts by “least
significant digits”
First sort by digit in units place
Second sort by digit in tens place
Third sort by digit in hundreds place
…….
23-Mar-17 94
Let’s sort the following array using radix sort:
64 8 216 512 27 729 0 1 343 125
23-Mar-17 95
Pass 1
23-Mar-17 96
0
9
23-Mar-17 97
64 8 216 512 27 729 0 1 343 125
9
23-Mar-17 98
64 8 216 512 27 729 0 1 343 125
9
23-Mar-17 99
64 8 216 512 27 729 0 1 343 125
4 64
9
23-Mar-17 100
64 8 216 512 27 729 0 1 343 125
4 64
9
23-Mar-17 101
64 8 216 512 27 729 0 1 343 125
4 64
8 8
9
23-Mar-17 102
64 8 216 512 27 729 0 1 343 125
4 64
8 8
9
23-Mar-17 103
64 8 216 512 27 729 0 1 343 125
4 64
6 216
8 8
9
23-Mar-17 104
64 8 216 512 27 729 0 1 343 125
4 64
6 216
8 8
9
23-Mar-17 105
64 8 216 512 27 729 0 1 343 125
2 512
4 64
6 216
8 8
9
23-Mar-17 106
64 8 216 512 27 729 0 1 343 125
2 512
4 64
6 216
8 8
9
23-Mar-17 107
64 8 216 512 27 729 0 1 343 125
2 512
4 64
6 216
7 27
8 8
9
23-Mar-17 108
64 8 216 512 27 729 0 1 343 125
2 512
4 64
6 216
7 27
8 8
9
23-Mar-17 109
64 8 216 512 27 729 0 1 343 125
2 512
4 64
6 216
7 27
8 8
9 729
23-Mar-17 110
64 8 216 512 27 729 0 1 343 125
2 512
4 64
6 216
7 27
8 8
9 729
23-Mar-17 111
64 8 216 512 27 729 0 1 343 125
0 0
2 512
4 64
6 216
7 27
8 8
9 729
23-Mar-17 112
64 8 216 512 27 729 0 1 343 125
0 0
2 512
4 64
6 216
7 27
8 8
9 729
23-Mar-17 113
64 8 216 512 27 729 0 1 343 125
0 0
1 1
2 512
4 64
6 216
7 27
8 8
9 729
23-Mar-17 114
64 8 216 512 27 729 0 1 343 125
0 0
1 1
2 512
4 64
6 216
7 27
8 8
9 729
23-Mar-17 115
64 8 216 512 27 729 0 1 343 125
0 0
1 1
2 512
3 343
4 64
6 216
7 27
8 8
9 729
23-Mar-17 116
64 8 216 512 27 729 0 1 343 125
0 0
1 1
2 512
3 343
4 64
6 216
7 27
8 8
9 729
23-Mar-17 117
64 8 216 512 27 729 0 1 343 125
0 0
1 1
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 118
64 8 216 512 27 729 0 1 343 125
0 0
1 1
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 119
0 0
1 1
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 120
0 0
1 1
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 121
0
0 0
1 1
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 122
0
1 1
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 123
0
1 1
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 124
0 1
1 1
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 125
0 1
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 126
0 1 512
2 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 127
0 1 512
3 343
4 64
5 125
6 216
7 27
8 8
9 729
23-Mar-17 128
Pass 2
23-Mar-17 129
0 1 512 343 64 125 216 27 8 729
9
23-Mar-17 130
00 1 512 343 64 125 216 27 8 729
9
23-Mar-17 131
0 1 512 343 64 125 216 27 8 729
0 0
9
23-Mar-17 132
0 01 512 343 64 125 216 27 8 729
0 0
9
23-Mar-17 133
0 1 512 343 64 125 216 27 8 729
0 0 1
9
23-Mar-17 134
0 1 512 343 64 125 216 27 8 729
0 0 1
9
23-Mar-17 135
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512
9
23-Mar-17 136
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512
9
23-Mar-17 137
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512
4 343
9
23-Mar-17 138
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512
4 343
9
23-Mar-17 139
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512
4 343
6 64
9
23-Mar-17 140
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512
4 343
6 64
9
23-Mar-17 141
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512
2 125
4 343
6 64
9
23-Mar-17 142
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512
2 125
4 343
6 64
9
23-Mar-17 143
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512 216
2 125
4 343
6 64
9
23-Mar-17 144
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512 216
2 125
4 343
6 64
9
23-Mar-17 145
0 1 512 343 64 125 216 27 8 729
0 0 1
1 512 216
2 125 27
4 343
6 64
9
23-Mar-17 146
0 1 512 343 64 125 216 27 08 729
0 0 1
1 512 216
2 125 27
4 343
6 64
9
23-Mar-17 147
0 1 512 343 64 125 216 27 8 729
0 0 1 8
1 512 216
2 125 27
4 343
6 64
9
23-Mar-17 148
0 1 512 343 64 125 216 27 8 729
0 0 1 8
1 512 216
2 125 27
4 343
6 64
9
23-Mar-17 149
0 1 512 343 64 125 216 27 8 729
0 0 1 8
1 512 216
2 125 27 729
4 343
6 64
9
23-Mar-17 150
0 1 512 343 64 125 216 27 8 729
0 0 1 8
1 512 216
2 125 27 729
4 343
6 64
9
23-Mar-17 151
0 0 1 8
1 512 216
2 125 27 729
4 343
6 64
9
23-Mar-17 152
0 1 8
0 0 1 8
1 512 216
2 125 27 729
4 343
6 64
9
23-Mar-17 153
0 1 8
1 512 216
2 125 27 729
4 343
6 64
9
23-Mar-17 154
0 1 8 512 216
1 512 216
2 125 27 729
4 343
6 64
9
23-Mar-17 155
0 1 8 512 216
2 125 27 729
4 343
6 64
9
23-Mar-17 156
0 1 8 512 216 125 27 729
2 125 27 729
4 343
6 64
9
23-Mar-17 157
0 1 8 512 216 125 27 729
4 343
6 64
9
23-Mar-17 158
0 1 8 512 216 125 27 729 343
4 343
6 64
9
23-Mar-17 159
0 1 8 512 216 125 27 729 343
6 64
9
23-Mar-17 160
0 1 8 512 216 125 27 729 343 64
6 64
9
23-Mar-17 161
Pass 3
23-Mar-17 162
0 1 8 512 216 125 27 729 343 64
9
23-Mar-17 163
000 1 8 512 216 125 27 729 343 64
9
23-Mar-17 164
0 1 8 512 216 125 27 729 343 64
0 0
9
23-Mar-17 165
0 001 8 512 216 125 27 729 343 64
0 0
9
23-Mar-17 166
0 1 8 512 216 125 27 729 343 64
0 0 1
9
23-Mar-17 167
0 1 008 512 216 125 27 729 343 64
0 0 1
9
23-Mar-17 168
0 1 8 512 216 125 27 729 343 64
0 0 1 8
9
23-Mar-17 169
0 1 8 512 216 125 27 729 343 64
0 0 1 8
9
23-Mar-17 170
0 1 8 512 216 125 27 729 343 64
0 0 1 8
5 512
9
23-Mar-17 171
0 1 8 512 216 125 27 729 343 64
0 0 1 8
5 512
9
23-Mar-17 172
0 1 8 512 216 125 27 729 343 64
0 0 1 8
2 216
5 512
9
23-Mar-17 173
0 1 8 512 216 125 27 729 343 64
0 0 1 8
2 216
5 512
9
23-Mar-17 174
0 1 8 512 216 125 27 729 343 64
0 0 1 8
1 125
2 216
5 512
9
23-Mar-17 175
0 1 8 512 216 125 027 729 343 64
0 0 1 8
1 125
2 216
5 512
9
23-Mar-17 176
0 1 8 512 216 125 27 729 343 64
0 0 1 8 27
1 125
2 216
5 512
9
23-Mar-17 177
0 1 8 512 216 125 27 729 343 64
0 0 1 8 27
1 125
2 216
5 512
9
23-Mar-17 178
0 1 8 512 216 125 27 729 343 64
0 0 1 8 27
1 125
2 216
5 512
7 729
9
23-Mar-17 179
0 1 8 512 216 125 27 729 343 64
0 0 1 8 27
1 125
2 216
5 512
7 729
9
23-Mar-17 180
0 1 8 512 216 125 27 729 343 64
0 0 1 8 27
1 125
2 216
3 343
5 512
7 729
9
23-Mar-17 181
0 1 8 512 216 125 27 729 343 064
0 0 1 8 27
1 125
2 216
3 343
5 512
7 729
9
23-Mar-17 182
0 1 8 512 216 125 27 729 343 64
0 0 1 8 27 64
1 125
2 216
3 343
5 512
7 729
9
23-Mar-17 183
0 1 8 512 216 125 27 729 343 64
0 0 1 8 27 64
1 125
2 216
3 343
5 512
7 729
9
23-Mar-17 184
0 0 1 8 27 64
1 125
2 216
3 343
5 512
7 729
9
23-Mar-17 185
0 1 8 27 64
0 0 1 8 27 64
1 125
2 216
3 343
5 512
7 729
9
23-Mar-17 186
0 1 8 27 64
1 125
2 216
3 343
5 512
7 729
9
23-Mar-17 187
0 1 8 27 64 125
1 125
2 216
3 343
5 512
7 729
9
23-Mar-17 188
0 1 8 27 64 125
2 216
3 343
5 512
7 729
9
23-Mar-17 189
0 1 8 27 64 125 216
2 216
3 343
5 512
7 729
9
23-Mar-17 190
0 1 8 27 64 125 216
3 343
5 512
7 729
9
23-Mar-17 191
0 1 8 27 64 125 216 343
3 343
5 512
7 729
9
23-Mar-17 192
0 1 8 27 64 125 216 343
5 512
7 729
9
23-Mar-17 193
0 1 8 27 64 125 216 343 512
5 512
7 729
9
23-Mar-17 194
0 1 8 27 64 125 216 343 512
7 729
9
23-Mar-17 195
0 1 8 27 64 125 216 343 512 729
7 729
9
23-Mar-17 196
0 1 8 27 64 125 216 343 512 729
9
23-Mar-17 197
The End
LECTURE NOTES BY
23-Mar-17 198