1/13
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
what is the first step of the bubble sort algorithm?
start at the left-hand end of the list unless specified otherwise
how does the bubble sort algorithm process comparisons?
compare the first and second values and swap if necessary, then continue comparing and swapping adjacent values along the list.
how does bubble sort reduce the list in each pass?
after each pass, the highest unsorted value is fixed at the end of the list, so the next pass excludes the last sorted value.
when does the bubble sort algorithm stop?
when a pass completes with no swaps or the list is reduced to length 1.
what is the first step of the shuttle sort algorithm?
start at the left-hand side of the list unless specified otherwise
how does the first pass of shuttle sort work?
compare the second value with the first and swap if necessary.
how does the shuttle mechanism work in shuttle sort?
if a swap happens, shuttle back to compare and potentially swap previous pairs again.
how does shuttle sort continue through the list?
on each pass, compare the next value with the previous one and shuttle back if swaps occur, repeating this for all passes.
when does shuttle sort stop?
after passes equal to the length of the list have been completed.
what is the first step in quick sort?
choose the first value in the sublist as the pivot unless specified otherwise.
how does quick sort partition the list?
write down values smaller than the pivot, then the pivot, then values not smaller, forming two sublists.
do values need to stay in order during quick sort partitioning?
no, values smaller than the pivot do not need to maintain their original order.
what do you do after the first pass in quick sort?
apply the same procedure to each sublist unless it contains only one entry.
when does quick sort stop?
when all sublists have one or zero elements.