Six original Cambridge-style questions on the linear search and bubble sort standard methods.
Describe how a linear search finds an item in an array.
The array Scores holds 12, 45, 7, 45, 30. A linear search for 45 stops when it finds the first match. State how many comparisons are made and the position output. Then state how many comparisons are made for a search for 8.
Show the list 8, 6, 9, 2 after each pass of a bubble sort into ascending order.
The array Prices[1:10] holds real numbers. Write pseudocode for a bubble sort that puts Prices into ascending order, stopping when a pass makes no swaps.
Explain why a bubble sort needs a temporary variable when it swaps two values.
A bubble sort is run on a list that is already in ascending order. Explain how many passes a sort with a swap flag makes, and why.
Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.