Skip to content
Marlbridge

Flashcards · 9210 · Topic 1

Algorithms flashcards

9 cards on Topic 1. Pick a subtopic or study them all.

Study mode needs JavaScript. Every card is listed below, so you can still cover the answers and test yourself.

All 9 cards

For a quick read-through or printing. Cover the right-hand side to test yourself.

Topic 1: Algorithms

What is an algorithm?
A sequence of steps that solves a problem or completes a task. It must be unambiguous, finite and produce a result. A program is one implementation of an algorithm in a particular language.
What is decomposition?
Breaking a problem into smaller, manageable sub-problems.
What is abstraction?
Removing unnecessary detail to focus on what matters, e.g. an underground map keeps the connections but drops real distances.
What is algorithmic thinking?
Devising the sequence of steps that solves the problem.
What do the four main flowchart symbols mean?
Oval/rounded: start and stop. Parallelogram: input and output. Rectangle: process. Diamond: decision, with two labelled exits, Yes and No.
What is the difference between a linear search and a binary search?
Linear: checks each item in turn; works on data in any order; slow on large sets. Binary: compares the middle item and discards half each time; the data must be sorted; much faster.
How does a bubble sort work?
Repeatedly compare adjacent pairs and swap them if out of order. After each pass the largest remaining item has moved to the end. Stop when a pass makes no swaps.
How does a merge sort work?
Divide the list in half repeatedly until each part holds one item, then merge the parts back together in order. Faster than bubble sort on large lists but more complex.
What is a trace table used for?
Recording the value of each variable (one column each) as an algorithm runs line by line, to work out its output and find logic errors.