Menu

Search Algorithms Exam Questions

14 Edexcel GCSE Computer Science (1CP2) exam-style questions on Search Algorithms (1.2 Algorithms), 33 marks in all. Answer them on paper or print them, then open the mark schemes and example answers to see how each is marked.

Revise Search Algorithms first

Build a paper on 1.2 Algorithms
Print
Download
1Multiple choice1 mark

A binary search is being used to find a target value in a sorted array. The target value is smaller than the value at the mid-point of the array.

Identify what the binary search does next.

[1 mark]
  • AChecks each item from the start of the array
  • BDiscards the first half of the array
  • CDiscards the item at the mid-point only
  • DDiscards the second half of the array
Mark scheme
  • D Discards the second half of the array (1)
  • The only correct answer is D. The correct answer is discards the second half of the array.
  • A is not correct because checking each item from the start of the array is how a linear search works, not a binary search
  • B is not correct because the target value is smaller than the mid-point, so it must be in the first half, which is kept and searched again
  • C is not correct because the mid-point has already been compared and is not the target, so it is discarded along with the second half
Example answers and how they were marked
Full marks1/1

D Discards the second half of the array

Why: Selects the correct option (1): the target is smaller than the mid-point, so the mid-point and the second half are discarded.

No marks0/1

B Discards the first half of the array

Why: Discards the wrong half; the target is smaller than the mid-point, so the first half is the part that must be searched again.

No marks0/1

A Checks each item from the start of the array

Why: Describes a linear search rather than a binary search, so no credit.

2Multiple choice1 mark

Identify the search algorithm that checks each item in turn until the target is found or the end of the array is reached.

[1 mark]
  • ABinary search
  • BBubble sort
  • CLinear search
  • DMerge sort
Mark scheme
  • C Linear search (1)
  • The only correct answer is C. The correct answer is linear search.
  • A is not correct because a binary search repeatedly halves the array and discards one half
  • B is not correct because a bubble sort compares and swaps pairs of items to put them in order
  • D is not correct because a merge sort divides the array into smaller arrays and merges them
Example answers and how they were marked
Full marks1/1

C Linear search

Why: Selects the correct option; a linear search checks each item in turn.

No marks0/1

A Binary search

Why: Binary search halves the array rather than checking each item in turn; this is a distractor.

No marks0/1

B Bubble sort

Why: Confuses a sorting algorithm with a search algorithm; bubble sort does not search for a target.

3Multiple choice1 mark

An array contains 12 items. The target value is not in the array.

Identify the maximum number of comparisons a linear search will make.

[1 mark]
  • A1
  • B11
  • C12
  • D13
Mark scheme
  • C 12 (1)
  • The only correct answer is C. The correct answer is 12.
  • A is not correct because 1 comparison would only be made if the target were the first item, and here every item must be checked
  • B is not correct because 11 is the index of the last item in an array of 12 items, not the number of comparisons
  • D is not correct because 13 is more than the number of items, and a linear search compares each item once
Example answers and how they were marked
Full marks1/1

C 12

Why: Selects the correct option; with the target not in the array, a linear search compares the target with each of the 12 items.

No marks0/1

B 11

Why: Gives the index of the last item rather than the number of comparisons, so earns no mark.

No marks0/1

A 1

Why: Shows the misconception that a linear search stops after one comparison; it must check every item, so this earns no mark.

4Short recall2 marks

A linear search can be used to find a value in an array.

Define the term linear search.

[2 marks]
Mark scheme

Award one mark for any of the following up to a maximum of two marks:

  • Starts at the first item/the beginning of the list/array/first element/index 0 (1)
  • Compares each item/element with the target/search value, one item at a time/in turn (1)
  • Stops when the target/search value is found (1)
  • Stops when the end of the list/array is reached without the target being found/and reports that the value is not in the list (1)
  • The list does not need to be sorted/can be used on an unsorted list (1)

Do not accept 'it splits/halves the list', which describes a binary search

Do not accept 'it looks through the list'/'it searches every item' without a comparison to the target

Example answers and how they were marked
Full marks2/2

A linear search starts at the first item in the list and compares each item with the target in turn. It stops when the target is found, or when it reaches the end of the list without finding it.

Why: Starts at the first item (1) and compares each item with the target, one at a time (1); the stopping points are also creditworthy but the answer is capped at two marks.

Some marks1/2

It compares the target with each item in the list, one after the other.

Why: Compares each item with the target one at a time (1); no other part of the definition is given.

No marks0/2

It splits the list in half and checks the middle item, then repeats this until the item is found.

Why: This describes a binary search, not a linear search, so no mark scheme point is met.

5Short recall2 marks

A binary search can be used to find a value in a sorted array.

State two things that happen at each step of a binary search.

[2 marks]
Mark scheme

Award one mark for any of the following up to a maximum of two marks:

  • The mid-point/middle item of the array (or of the remaining items) is found (1)
  • The target/search value is compared with the value at the mid-point/middle item (1)
  • The half (of the array) that cannot contain the target is discarded/ignored/not searched (1)
  • The search is repeated on the remaining half/the half that is left (1)

Do not accept 'the array is split and both halves are searched'

Do not accept 'it checks every item until the target is found', which describes a linear search

Example answers and how they were marked
Full marks2/2

The target value is compared with the middle item of the array. The half of the array that cannot contain the target is discarded.

Why: Comparison with the middle item (1) and discarding the half that cannot contain the target (1).

Some marks1/2

The target value is compared with the middle item of the array.

Why: Comparison with the middle item (1); nothing is said about discarding a half or repeating the search.

No marks0/2

It starts at the first item and checks each item in turn until the target value is found.

Why: This describes a linear search, not a binary search; no mark scheme point is met.

6Short recall2 marks

A linear search and a binary search can be used to search the same array.

State two measures that can be used to compare the efficiency of a linear search and a binary search.

[2 marks]
Mark scheme

Award one mark for any of the following up to a maximum of two marks:

  • The number of comparisons made (1)
  • The number of passes through a loop/iterations (1)
  • The amount of memory used/use of memory (1)
  • The time taken to run/number of operations (1)

Do not accept the number of items in the array/list, the programming language used or the number of lines of code

Example answers and how they were marked
Full marks2/2

The number of comparisons each search makes and the amount of memory each one uses.

Why: Number of comparisons (1) and amount of memory used (1).

Some marks1/2

The number of comparisons it makes.

Why: Number of comparisons (1); only one measure is given for a two-mark question.

No marks0/2

The number of items in the array and the programming language the code is written in.

Why: Neither is a measure of the efficiency of an algorithm, so no mark scheme point is met; both are named in the Do not accept line.

7Describe2 marks

A school keeps a list of student names in alphabetical order. A binary search is used to find a name.

Describe how a binary search finds a name in the sorted list.

[2 marks]
Mark scheme

Award up to two marks for a linked description such as:

  • Finds/examines the middle item/name (in the list) (1) and compares it with the name/target being searched for (1)
  • If the name/target comes before the middle item (alphabetically) (1) the middle item and the upper/later half of the list are discarded / the search continues on the lower/earlier half (1)
  • If the name/target comes after the middle item (alphabetically) (1) the middle item and the lower/earlier half of the list are discarded / the search continues on the upper/later half (1)
  • The middle item of the remaining half is found and compared with the name/target (1) so the process repeats until the name is found or no items are left (1)

Allow 'checks/looks at the middle name' for the middle item mark, but the comparison mark needs a reference to the name/target being searched for.

Allow a candidate who says the half is discarded and then says the search repeats on the remaining half to gain both marks, e.g. 'the upper half is discarded (1) then the search is repeated on the lower half (1)'.

Accept the lower/earlier half or the upper/later half being kept instead of discarded, e.g. 'it now only searches the lower half (1)'.

Do not award the end condition (name found / no items left) as the second mark for the middle item point, as it is not a development of the comparison.

Allow 'splits the list in half' for finding the middle item (1), but not for the discard mark, as it does not say which items are discarded.

Ignore 'divide and conquer' on its own, as it does not describe what is compared or discarded.

Do not accept descriptions of a linear search, such as starting at the first name and checking each name in turn.

Example answers and how they were marked
Full marks2/2

It finds the middle name in the list and compares it with the name being searched for. If the target name comes before it in the alphabet, the middle name and all the later names are discarded, and the search repeats on the lower half.

Why: Middle item compared with the target (1) and the half discarded before repeating on the remaining half (1).

Some marks1/2

It finds the middle name in the list.

Why: Middle item found (1); no comparison with the target and no discard of a half (1).

No marks0/2

It starts at the first name in the list and checks each name until the target is found.

Why: Describes a linear search, which the mark scheme says not to accept; no mark.

8Describe2 marks

A supermarket stores its product codes in an unsorted list.

Describe how a linear search decides that a product code is not in the list.

[2 marks]
Mark scheme

Award up to two marks for a linked description such as:

  • Compares the target (product code) with each item/product code in the (unsorted) list (1) from the first item to the last (1)
  • Checks/compares every item in the list (1) and if none of them is a match, the code is not in the list (1)
  • Reaches the end of the list (1) without finding a match, so reports/decides that the product code is not in the list (1)
  • Keeps looping/iterating through the list to the end (1) because a code that is not in the list never produces a match (1)

Allow 'checks every item' on its own for one mark (the comparison of each item), but not the second mark without the end-of-list/not found decision.

Do not accept answers that check the middle item or discard half of the list; that describes a binary search.

Do not award credit for 'stops/it stops when it finds the code' on its own, as this does not show how the search decides the code is not in the list.

Example answers and how they were marked
Full marks2/2

It compares the product code with each code in the list, one at a time from the start. If it reaches the end of the list without a match, it decides the code is not in the list.

Why: Compares each code in turn (1) and uses reaching the end without a match to decide it is absent (1).

Some marks1/2

It checks every product code in the list.

Why: Checking every item earns the comparison mark (1); no end-of-list/no-match decision linked to it (1).

No marks0/2

It looks at the middle code and discards half of the list.

Why: Describes a binary search; do not accept.

9Describe2 marks

A library keeps a sorted list of 10,000 book titles. A binary search and a linear search can both be used to find a title.

Describe how a binary search is more efficient than a linear search for this list.

[2 marks]
Mark scheme

Award up to two marks for a linked description such as:

  • A binary search checks the middle item first (1) then discards the half of the list that cannot contain the target (1)
  • A binary search halves/discards half of the remaining items after each comparison (1) so it makes fewer comparisons than a linear search (1)
  • A linear search checks items one by one (1) whereas a binary search discards half of the remaining items each time (1)
  • A linear search may have to compare the target with every item in the list (1) whereas a binary search removes half of the remaining items after each comparison (1)
  • For a large sorted list, a binary search needs far fewer comparisons (1) because each comparison eliminates half of the remaining items (1)

Allow 'checks the halfway point/middle item first' for the discarding mechanism.

Allow 'half the list is eliminated/removed/discarded each time' as the linked development.

Do not accept 'binary search uses less memory' or 'binary search is faster because the list is sorted' unless it refers to the number of comparisons/items checked.

Do not award a mark for simply saying one algorithm is faster or better.

A halving/discard point on its own earns one mark only if it is stated as a step that removes part of the list.

Example answers and how they were marked
Full marks2/2

A binary search discards half of the remaining titles after each comparison, so it makes far fewer comparisons than a linear search, which may have to compare the target with every title.

Why: Discarding half after each comparison (1) and linked to fewer comparisons than a linear search (1).

Some marks1/2

A binary search is more efficient because it halves the list by discarding the half that cannot contain the title.

Why: Halving/discard step (1); no linked comparison of the number of comparisons or items checked (1).

No marks0/2

A binary search uses less memory than a linear search, so it is more efficient.

Why: Memory use is not the efficiency comparison required; no creditworthy point.

10Explain2 marks

A sorted array can be searched using a linear search or a binary search.

Explain one reason why a binary search needs fewer comparisons than a linear search when the target value is not in the array.

[2 marks]
Mark scheme

Award up to two marks for a linked explanation such as:

  • Binary search halves/discards half of the remaining items after each comparison (1) so only a small number of items need to be compared before it can decide the target is not in the array (1)
  • Binary search checks the middle item and discards one half (1) so it does not compare the target with every item in the array before deciding it is not there (1)
  • Binary search halves the number of items still to be searched with each pass (1) so its maximum number of comparisons is far fewer than the number a linear search makes to reach the end of the array (1)
  • A linear search must compare the target with every item in the array to decide it is not there (1) whereas a binary search discards half of the items each time so makes far fewer comparisons (1)

For both marks, the expansion must follow/associate with the statement.

A statement that a binary search halves/discards half of the items on its own, with no linked reason about fewer items/comparisons being checked, earns one mark only.

Do not accept 'binary search is faster/quicker' or 'binary search is more efficient' on its own without saying that fewer items/comparisons are checked.

Do not accept answers about sorting the array; the question asks about searching an array that is already sorted.

Example answers and how they were marked
Full marks2/2

Binary search discards half of the remaining items after each comparison, so it compares far fewer items than a linear search before it can decide the target is not in the array.

Why: Point (1) for discarding half of the remaining items and linked reason (1) for comparing far fewer items before deciding the target is not there.

Some marks1/2

A binary search discards half of the array each time it checks an item.

Why: Point only (1); no linked reason that this means fewer items/comparisons are checked.

No marks0/2

A binary search is quicker, so it is more efficient than a linear search.

Why: No creditworthy point; saying quicker/more efficient without saying that fewer items or comparisons are checked is covered by the 'Do not accept' line.

11Explain2 marks

A binary search can only be used on a sorted array.

Explain one reason why a binary search cannot be used on an array that is not sorted.

[2 marks]
Mark scheme

Award up to two marks for a linked explanation such as:

  • A binary search compares the target with the middle item and discards one half of the array (1) because in an unsorted array the target could be in the half that is discarded (1)
  • A binary search uses the order of the items to decide which half to keep searching (1) so in an unsorted array it may keep the wrong half and miss the target (1)
  • The middle item is only a reliable split point when the array is sorted (1) so in an unsorted array the search may discard the half that contains the target (1)

For both marks, the expansion must follow/associate with the statement.

Allow 'discard the wrong half' / 'it might miss the item' / 'it may skip over the target' as the linked reason (1) when it follows a statement about discarding/choosing a half.

Do not accept 'it needs to be sorted' / 'it only works on sorted data' on its own without saying what goes wrong, e.g. that the target may be discarded/missed.

Do not accept answers about speed, e.g. that a linear search is slower/faster; the question asks why a binary search cannot be used.

Example answers and how they were marked
Full marks2/2

A binary search compares the target with the middle item and discards one half of the array, but if the array is not sorted the target could be in the half that is discarded.

Why: Point (1) for comparing with the middle item and discarding a half, and linked reason (1) that the target could be in the discarded half.

Some marks1/2

A binary search compares the target with the middle item and discards half of the array.

Why: Point (1) for discarding a half based on the middle item; no linked reason that an unsorted array may put the target in the discarded half.

No marks0/2

A binary search cannot be used because it is slower than a linear search on an unsorted array.

Why: No creditworthy point; the answer gives speed as the reason, which the mark scheme does not accept.

12Explain2 marks

A linear search checks the items in an array one at a time.

Explain one reason why the linear search is efficient when the target value is the first item in the array.

[2 marks]
Mark scheme

Award up to two marks for a linked explanation such as:

  • The first item checked matches the target (1) so the search stops (after one comparison) (1)
  • Only one comparison/item is needed (1) so the rest of the array does not have to be checked (1)
  • The search ends as soon as the first comparison is made (1) because the item at index 0 is the target (1)
  • No further passes through the array are needed (1) because the target is found at the first position/index 0 (1)

For both marks, the expansion must follow/associate with the statement.

Do not accept 'it is fast' or 'it finds it quickly' without saying that only one comparison/item is checked or that the search stops.

Do not accept 'it finds the target' or 'the search stops when it finds the target' on its own, without saying that this happens at the first item/after one comparison.

Example answers and how they were marked
Full marks2/2

The first item checked matches the target, so the search stops after one comparison.

Why: Point (1) for the first item matching the target and linked reason (1) for the search stopping after one comparison.

Some marks1/2

Only one item needs to be checked.

Why: Point only (1); no linked reason that the search stops because the first item matches.

No marks0/2

The linear search must check every item before it finds the target.

Why: No creditworthy point; this is a misconception, because the target is the first item and the search stops.

13Discuss6 marks

An online shop stores its product codes in a list that is not kept in any order. Each time a customer searches, the website checks whether the product code is in the list using a linear search. A developer has suggested keeping the codes in alphabetical order and using a binary search instead.

Discuss the issues the shop faces in deciding whether to change to a binary search.

Your answer should include:

  • how a linear search finds a product code in the list
  • how a binary search finds a product code in the list
  • the changes the shop would need to make.
[6 marks]
Mark scheme

Indicative content

How a linear search finds a product code

  • The search starts at the first code in the list and compares it with the code the customer entered.
  • It then moves to the next code in the list and repeats the comparison until it finds the code that matches.
  • It stops when the code is found, or when it reaches the end of the list without a match, which shows the code is not in the list.
  • It works on the list as it is, so the shop would not have to change the way the codes are stored.
  • A code near the end of the list, or a code that is not in the list at all, means every code is compared, so on a long list this search takes a long time.

How a binary search finds a product code

  • It compares the code the customer entered with the middle code in the sorted list.
  • If the wanted code comes after the middle code alphabetically, the middle code and the lower half of the list are discarded.
  • If the wanted code comes before the middle code alphabetically, the middle code and the upper half of the list are discarded.
  • It repeats this with the middle code of the half that is left, so the number of codes still being searched is halved at each step.
  • It stops when the code is found, or when there are no codes left to search, which shows the code is not in the list.
  • On a long list it needs far fewer comparisons than a linear search, because the half that is not needed is never searched.

Changes the shop would need to make

  • The list of codes would have to be sorted before a binary search could be used.
  • Each new product code would have to be inserted into the correct place in the list, or the whole list re-sorted, whenever codes are added or removed.
  • Keeping the list in order is extra work for the shop every time its codes change, which an unsorted list does not need.
  • The shop would need to judge whether that extra work is outweighed by the faster searches the website would get.

Levels

  • Level 0 (0 marks): No rewardable content.
  • Level 1 (1–2 marks): Basic, independent points are made, showing elements of understanding of key concepts/principles of computer science. (AO1) The discussion will contain basic information with little linkage between points made or application to the context. (AO2)
  • Level 2 (3–4 marks): Demonstrates adequate understanding of key concepts/principles of computer science. (AO1) The discussion shows some linkages and lines of reasoning with some structure and application to the context. (AO2)
  • Level 3 (5–6 marks): Demonstrates comprehensive understanding of key concepts/principles of computer science to support the discussion being presented. (AO1) The discussion is well developed, with sustained lines of reasoning that are coherent and logically structured, and which clearly apply to the context. (AO2)

Level 3 responses must describe how both searches work, including which half is discarded and when each search stops, and must cover the work of keeping the list sorted.

Do not accept a binary search that picks items at random, removes one item at a time, or works on a list that is not sorted.

Example answers and how they were marked
Full marks6/6

A linear search starts at the first product code and compares it with the code the customer entered. If they do not match, it moves to the next code and repeats, stopping when it finds a match, or when it reaches the end of the list and reports that the code is not there. A binary search can only be used on a sorted list, so the shop would first have to put the codes into alphabetical order. It checks the middle code: if the wanted code comes after it alphabetically the lower half is discarded, and if it comes before it the upper half is discarded, so the list being searched is halved each time until the code is found or nothing is left. On a long list this means far fewer comparisons than a linear search, which may have to check every code. However, the shop would then have to insert every new product code in the right place, or re-sort the list, whenever codes are added or removed, so it has to judge whether the faster searches are worth that extra work.

Why: Describes the linear search comparing codes in turn and stopping on a match or at the end, describes the binary search discarding the correct half each time and halving the list, compares the number of comparisons and applies the ongoing work of keeping the codes sorted to the shop's decision: sustained reasoning applied to the context, Level 3.

Some marks2/6

A linear search checks each product code one at a time, starting from the first one, until it finds the code it wants. A binary search is quicker because it starts at the middle of the list and keeps halving it. The shop would need to sort the list before it could use a binary search.

Why: Basic independent points only: the linear search checking codes in turn (1) and the binary search halving the list and the need for a sorted list (1), but it does not say which half is discarded or when the search stops, and nothing is applied to the shop's searches or to keeping the list sorted, so it cannot reach Level 2: top of Level 1 (2 marks).

Some marks1/6

A linear search looks at every code in the list and then tells the user whether the code is there. A binary search is better because it picks a random code from the list to check, so it works even when the list is not in order and the shop would not need to change anything.

Why: One basic point for the linear search working through the codes (1); the binary search is described as picking random codes and working on an unsorted list, which is a misconception and gains nothing.

14Discuss6 marks

A warehouse keeps the codes of 50,000 stock items in an array held in memory. Item codes are added and removed during the day, so the array is not in order. A developer is choosing between searching the array with a linear search, or sorting the array and then using a binary search. Each stock check must be answered quickly.

Discuss the issues the developer should consider when deciding which search is more efficient.

Your answer should consider:

  • the number of comparisons each search makes
  • the number of passes through the loop
  • the use of memory.

You do not need to consider the programming language used.

[6 marks]
Mark scheme

Indicative content

Number of comparisons

  • A linear search may compare the stock code with all 50,000 codes, which is the worst case when the code is last or not in the array.
  • The best case for a linear search is one comparison, when the first code matches.
  • A binary search compares the target with the middle code, then with the middle of the half that is left, so the number of codes still to check is halved each time.
  • 50,000 codes need at most about 16 comparisons in a binary search, because 2^16 is 65,536, which is far fewer than a linear search.
  • Fewer comparisons means each stock check is answered more quickly, which matters because the warehouse carries out many checks in a day.

Number of passes through the loop

  • Each pass of the loop in the linear search checks one code, so one search can need up to 50,000 passes.
  • Each pass of the loop in the binary search discards about half of the remaining codes, so the loop runs about 16 times at most.
  • The array is not in order, so it would have to be sorted before every binary search, and a sort such as bubble sort makes many passes over all 50,000 codes itself.
  • Because codes are added and removed during the day the array will not stay sorted, so the sorting work would be repeated and could outweigh the saving in the search.

Use of memory

  • Both searches work on the array already in memory and need only a few variables, such as the target and an index counter.
  • A binary search also needs variables for the start, end and mid-point indexes, so it uses slightly more memory than a linear search.
  • Some sorts, such as merge sort, need a second array to hold the merged lists, which needs extra memory for another 50,000 codes.
  • If memory is limited, the linear search on the array as it is avoids needing a sorted copy of the data.

Levels

  • Level 0 (0 marks): No rewardable content.
  • Level 1 (1–2 marks): Basic, independent points are made, showing elements of understanding of key concepts/principles of computer science. (AO1) The discussion will contain basic information with little linkage between points made or application to the context. (AO2)
  • Level 2 (3–4 marks): Demonstrates adequate understanding of key concepts/principles of computer science. (AO1) The discussion shows some linkages and lines of reasoning with some structure and application to the context. (AO2)
  • Level 3 (5–6 marks): Demonstrates comprehensive understanding of key concepts/principles of computer science to support the discussion being presented. (AO1) The discussion is well developed, with sustained lines of reasoning that are coherent and logically structured, and which clearly apply to the context. (AO2)

Level 3 responses must weigh the saving in comparisons against the cost of sorting the array, not describe only one search.

Do not accept a binary search being quicker on the unsorted array, or memory use being described as the search storing a copy of every code it compares.

Example answers and how they were marked
Full marks6/6

If the code is the last one in the array, or is not in it at all, a linear search compares it with all 50,000 codes, so that is its worst case, while a binary search halves the number of codes it still has to check each time. 50,000 codes need at most about 16 comparisons in a binary search, so each stock check would be answered much faster. The number of passes through the loop shows the same thing: one pass per code for the linear search but only about 16 passes for the binary search. However, the array is not in order and codes change during the day, so before every binary search the developer would have to sort the array, and a bubble sort would make many passes over all 50,000 codes itself, which could be slower overall than just searching. Memory also matters, because both searches on the array only need a few variables, but merge sort would need a second array of 50,000 codes to merge into.

Why: Compares the worst case comparisons (1) and gives the log-style figure of about 16 (1), compares the passes through the loop (1), then reasons that the sorting cost, repeated as codes change, could outweigh the saving (1) and compares memory use including merge sort's second array (1), all applied to the warehouse's need for quick stock checks (1).

Some marks3/6

A linear search might have to compare the stock code with all 50,000 codes, but a binary search halves the list each time it checks the middle one, so it only needs far fewer comparisons, about 16. That means the binary search would answer each stock check more quickly.

Why: Links the linear search worst case to the number of codes (1) with the binary search halving the list (1) and applies it to the quick stock check (1), but says nothing about passes through the loop or memory, so it only does one of the three bullets.

Some marks1/6

A binary search halves the list every time, so it is quicker than a linear search. A linear search uses lots of memory because it keeps a copy of every code it compares, and the developer only needs to sort the array once because it will stay sorted.

Why: One basic point for the binary search halving the list (1); the claims about the linear search copying every code into memory and the array staying sorted contradict the stem and gain no credit.

Keep practising Search Algorithms

More exam questions on 1.2 Algorithms

Teachers: print these as a worksheet with the mark schemes at the end, and sign your school up to set your classes activities on Search Algorithms.

Fetch Decode Explain isn't affiliated with or endorsed by Pearson Edexcel.