What are the pros and cons of a bubble sort?
Pros
Cons
What is the purpose of the temp variable in a bubble sort?
Allows you to swap two values without overwriting one of them.
What is the purpose of the swapsMade Boolean in a bubble sort?
When the algorithm reaches the end of a pass, if the Boolean is true then the list may not be sorted, so it needs to make at least one more pass.
If the end of the pass is reached and it is false, then then you have gone through the list, made no changes, so the list is sorted.
Show the steps of a bubble sort on the following array - clearly label the passes.
[95, 10, 5, 33, 100, 77, 45]
Describe the steps of a bubble sort on an array.
Write / describe the pseudocode for a Bubble Sort
Describe how an insertion sort works
What are the pros and cons of the insertion sort?
Show the steps of an insertion sort on the following array
[95, 10, 5, 33, 100, 77, 45]
Write / describe the pseudocode for an Insertion Sort
Describe how a linear search works
Start at the first element, if equal to search item, then report found
If not equal, then move to next element
Repeat for all elements until found or the end of the list reached
What are the pros and cons of a linear search?
Write / describe the pseudocode for a Linear Search
Describe a binary search
Describe the technicalities of a binary search
Demonstrate a binary search on the following array to find the value 47
[4, 7, 8, 21, 46, 47, 51]
Describe the pros and cons of a binary search
Write / describe the pseudocode for a Binary Search
Write the pseudocode to push an item to a stack
Write the pseudocode to pop an item to a stack
Keywords to describe a queue
Keywords to describe a stack
Write the pseudocode to dequeue an item to a queue
Write the pseudocode to enqueue an item to a queue