Skip to content
Marlbridge

Flashcards · 2210 · Topic 7

Algorithm design and problem-solving flashcards

10 cards on Topic 7. 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 10 cards

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

Topic 7: Algorithm design and problem-solving

What are the stages of the program development life cycle?
Analysis, design, coding and testing.
What is decomposition? Give an example
Breaking a problem into smaller sub-problems that can be solved and tested separately, e.g. a library system split into searching, borrowing, returning and fines.
What is abstraction? Give an example
Removing unnecessary detail to focus on what matters, e.g. a rail map that shows the order of stations but not the real distances.
Which flowchart symbol is used for input/output, and which for a decision?
Input or output: a parallelogram. Decision: a diamond with labelled yes/no exits. A rectangle is a process; a rounded terminator marks start and end.
How do you find the maximum value in a list?
Set Highest to the first item (or a very low value). Compare each item in turn; if it is greater than Highest, replace Highest with it. Output Highest after the loop.
What happens in one pass of a bubble sort?
Each pair of adjacent items is compared and swapped if in the wrong order, from the start of the list to the end of the unsorted part. The largest unsorted item ends in its correct place.
Name six validation checks
Range check, length check, type check, presence check, format check and check digit.
Name two methods of verification
Double entry (the data is entered twice and the two compared) and a visual check (the data is compared by eye with the source).
What is boundary (extreme) test data?
Values at the edges of the valid range, which should be accepted, plus the values just outside it, which should be rejected. For 11 to 16: 11 and 16 accepted, 10 and 17 rejected.
Why must a running total be set to 0 before the loop?
Otherwise it starts with an unknown value, so every total calculated from it is wrong.