Year 7TechnologySupport
There is often more than one algorithm for the same job. Here you will search lists and sort them, count the steps each algorithm takes, and decide which algorithm is best. A check means looking at one item to see if it is the one you want.
ASearching
- 1.
What is a linear search?
1 mark- Checking the items one at a time, in order, until you find the one you want
- Starting in the middle of a sorted list and throwing away half each time
- Putting a list into order from smallest to largest
- Picking items at random until you find the one you want
- 2.
Use a linear search to find 23 in this list: 8, 15, 23, 4, 42. Start at the first number. How many numbers do you check?
1 mark - 3.
You do a linear search through 10 cards. The most cards you might need to check is .
1 mark - 4.
You play a guessing game. A friend picks a number from 1 to 100 and says "higher" or "lower" after each guess. Which first guess is best?
1 mark- 50
- 1
- 10
- 99
BSorting
- 5.
Match each word to its meaning.
4 marks- ascending
- descending
- search
- sort
- Ain order from largest to smallest
- Bput the items of a list in order
- Cin order from smallest to largest
- Dfind one item in a list
- 6.
Sort these numbers in ascending order: 7, 2, 9, 4.
1 mark - 7.
Binary search only works on a list that is sorted.
1 mark- True
- False
- 8.
The contacts on a phone are sorted from A to Z. Why is this helpful? Sentence starter: "Sorting the contacts helps because ..."
2 marks