levo

Algorithm Design and Problem-Solving

Standard methods of solution

  • 3 things to know
  • Paper 2
Start revising · £5/month

Overview

Linear search, bubble sort, totalling, counting and finding the maximum, minimum and average, with pseudocode.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Show the list 5, 3, 8, 1 after each pass of a bubble sort into ascending order

Key term

How should the purpose of an algorithm be explained?

Process

How does a bubble sort work?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    How should the purpose of an algorithm be explained?

    Model answer

    State what the algorithm achieves overall, then describe the processes it uses, such as its inputs, loops, decisions and outputs.

  2. 2

    How does a linear search work?

    Model answer

    A linear search checks each item in a list in turn, starting from the first, until the item is found or the end of the list is reached.

  3. 3

    Give one advantage and one disadvantage of a linear search.

    Model answer

    A linear search works on an unsorted list. A linear search is slow for a long list, because every item may need to be checked.

  4. 4

    How does a bubble sort work?

    Model answer

    A bubble sort compares each pair of adjacent items and swaps them if they are in the wrong order. Passes through the list are repeated until a pass makes no swaps.

  5. 5

    Show the list 5, 3, 8, 1 after each pass of a bubble sort into ascending order.

    Model answer

    After the first pass the list is 3, 5, 1, 8. After the second pass the list is 3, 1, 5, 8. After the third pass the list is 1, 3, 5, 8.

  6. 6

    Why is a flag used in an efficient bubble sort?

    Model answer

    A flag records whether any swap was made during a pass. If no swap was made, the list is sorted and the algorithm stops early.

Other ways to work this

The same content, four other ways.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Data Representation
Data Transmission
Hardware
Software

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

A robot is .
programmableportablehumanoid

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

A nibble is 4 bits. A byte is 8 bits.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Algorithm Design and Problem-Solving, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.