COUNTING SORT

7

Transcript of COUNTING SORT

Page 1: COUNTING SORT
Page 2: COUNTING SORT

When k = O(n) then the sort runs in O(n) time

Determine how many elements are less than an element x

Then place x directly in its correct position

Page 3: COUNTING SORT
Page 4: COUNTING SORT
Page 5: COUNTING SORT
Page 6: COUNTING SORT
Page 7: COUNTING SORT