Other sort aglogos

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

7 Terms

1
New cards

bucketsort idea

1. Divide interval [a, b) into B (equally sized) subintervals (’Buckets’)

2. Sort the numbers in each subinterval separately (e.g., with MergeSort)

  1. concatenate subseq


2
New cards

Bucket assignment

can be implemented as an array with a list in each entry

worst case: all in 1 bucket

best case: evenly sorted

<p>can be implemented as an array with a list in each entry</p><p>worst case: all in 1 bucket</p><p>best case: evenly sorted</p>
3
New cards

Counting sort algo

1. Create array C of length k.

2. For each number in the input ai, set C[ai] to C[ai] + 1 (’Counting’).

3. Traverse C from left to right and write out the values with corresponding

frequency.


4
New cards

counting sort issue and solution

Prob: Values were keys of complex objects

cummulative freq


<p>Prob: Values were keys of complex objects</p><p>cummulative freq</p><p></p>
5
New cards

Radixsort idea

Similar to CountingSort, but digit-wise from back to front(LSD)

d-ary digits with s places

6
New cards

Radixsort algo

Sort by last digit with CountingSort (with k=d)

i. Sort by (s+1-i)th digit with CountingSort (with k=d)

inc d, smaller s

7
New cards

Overview of sorting methods

knowt flashcard image