Flowchart Tracing and Algorithm Efficiency
Trace standard flowcharts and describe how time and space complexity affect algorithm scalability.
What you need to be able to do
- recognize the standard flowchart symbols and trace control flow;
- track variables and determine output from a flowchart;
- distinguish time complexity from space complexity;
- describe common Big O growth patterns and what they mean for scalability;
- choose between correct algorithms using efficiency and scalability requirements.
Rapid Recall Deck
Attempt each card first. If a term is new, flip and study it, then answer it again without looking. Mark only secure recall as “Know it”.
Recognize the standard symbols
Start / End
Process / Operation
Input/Output
Decision
Flowline
Arrow showing the direction of control.
Connector
Links separated flowchart regions.
Follow control and variable changes
Trace for n = 4
At the decision: (1,0), (2,1), (3,3), (4,6), (5,10). When i = 5, 5 ≤ 4 is False, so the flowchart outputs 10.
Big O describes growth
Time complexity
How the amount of work or running time grows as input size n grows.
Space complexity
How the additional memory required by the algorithm grows as n grows.
O(1)
Approximately constant growth.
O(log n)
Growth slows because the remaining problem is repeatedly reduced.
O(n)
Work grows roughly in direct proportion to input size.
O(n²)
Work grows roughly with the square of input size.
Connect code structure to growth
Algorithm A
for value in data:
print(value)Algorithm B
for x in data:
for y in data:
print(x, y)Describe the time complexity
A: O(n) time because the loop performs work once for each input item, so doubling n roughly doubles the iterations. B: O(n²) time because the nested loops produce roughly n × n pairs, so doubling n can produce about four times as many iterations.
Choose an algorithm for the data size
Describe the choice
The input may grow from 100 records to 1,000,000 records. Which algorithm is more scalable, and why?
Algorithm X is more scalable for very large inputs because its time grows linearly with n, whereas Algorithm Y's time grows quadratically. The difference becomes much larger as n increases. Both have O(1) extra space here, so the main deciding factor is the time-growth requirement.
Teacher-created Paper 2 practice
1. A flowchart uses a diamond containing count < 5?. Explain what the diamond controls.
2. An algorithm performs one constant-time check for each item in a List of length n. State and describe its time complexity.
3. Algorithm P uses O(log n) time and Algorithm Q uses O(n) time for the same search task. Describe why P may be preferable as n becomes very large.
- The decision evaluates the condition and directs control along one of the outgoing paths depending on whether the condition is True or False.
- O(n): the work grows roughly in direct proportion to the number of items because each item is checked once.
- O(log n) grows more slowly than O(n), so as n becomes very large the number of steps increases much less rapidly, assuming the requirements of the logarithmic algorithm are satisfied.
Finish the learning cycle
IA — main task
Review the IA algorithms or planned processing steps. Identify one operation that may be repeated as the amount of data grows and note whether scalability could matter.
Syllabus — short retrieval
Redo the flowchart trace for a different input such as n = 5, then explain aloud the difference between O(n) and O(n²) without using a memorized definition.