levo

Algorithms

Coding and choosing algorithms

  • 3 things to know
  • Papers 1 and 2
Start revising · £5/month

Overview

Turning pseudocode into Python, how data structures and data values affect the choice of algorithm, and judging fitness for purpose.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What does coding an algorithm in a high-level language involve?

Key term

How is the pseudocode SET Total TO Total + Mark written in Python?

Key term

How is the pseudocode FOR Count FROM 1 TO 10 DO written in Python?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What does coding an algorithm in a high-level language involve?

    Model answer

    The programmer turns each step of the algorithm into statements of a language such as Python. The program is then tested to check it works.

  2. 2

    How is the pseudocode SET Total TO Total + Mark written in Python?

    Model answer

    The statement is written in Python as total = total + mark, or total += mark.

  3. 3

    How is the pseudocode FOR Count FROM 1 TO 10 DO written in Python?

    Model answer

    The loop is written in Python as for count in range(1, 11):. The range stops one before its upper value.

  4. 4

    How is the pseudocode RECEIVE Age FROM (INTEGER) KEYBOARD written in Python?

    Model answer

    The input is written in Python as age = int(input()). The int function converts the string entered into an integer.

  5. 5

    How does the data structure affect the choice of algorithm?

    Model answer

    A sorted array allows a fast binary search. An unsorted array needs a linear search or must be sorted first.

  6. 6

    How do the data values affect the choice of algorithm?

    Model answer

    A small amount of data can be handled by a simple algorithm such as bubble sort. A very large amount of data needs an efficient algorithm such as merge sort.

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.

Algorithms
Searching and Sorting Algorithms
Decomposition and Abstraction
Developing and Testing Code

Cram the night before, weakest topic first

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

Denary is a base system.
1028

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.

Nibble means a group of four 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 Algorithms, 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.