sorts

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

1/3

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:45 AM on 9/22/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

4 Terms

1
New cards

insertion sort

outer loop iterates through array starting from 1st index (j) to length-1, inner loop starts from 0 index (i)to length-2; if i>j greater insert at i position

in place stable

O(n)(best case) On^2 (worst case)

2
New cards

merge sort

split array into half until you reach 1 element array; compare on element arrays and combine

stable, in place

best and worse O(n log n)

3
New cards

heap sort

in place, (shrinks at front, sorted region grows at the tail) not stable (long distance swap reorders equal keys)

predictable but slower in practice

(n log n) worst case

4
New cards

quick sort

(lomuto scheme is quick sort but pivot is last element)

choose [last element] as pivot point, iterate through array and compare elements to pivot point. if j <= p, increase i by 1 and swap i and j

in place, not stable

best(n log n) worst case(n^2)

usually the fastest in practice