CS paper 2 Flashcards

1
Q

Key Features of Bubble sort

A

Uses an outer while loop (to test to see if no swaps where made in a pass)
Uses an inner for loop (repeated for the length of the code)
Uses a flag (boolean value) to track if a swap has been made
Uses a temporary value to help correctly swap elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Key features of merge sort

A

Calls itself within the subroutine (known as a recursive algorithm)
Splits the sublists continously left and right by 2 until each sublist has 1 value, then it’ll merge them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Key features of binary search

A

Uses a while loop repeatedly (to compare the midpoint to the target value)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly