Tree traversal and Reverse Polish notation
This worksheet marks itself
Set it as homework or classwork and every answer is marked as pupils go, with feedback on what they got wrong. The scores go straight into your mark book, so you can see who needs help before the next lesson.
- 11 questions
- 29 marks
- about 35 minutes
- marked instantly
Question types: multiple choice, short answer, matching, true or false.
Try one from this worksheet
Identify the output of a post-order traversal of the binary tree shown.
Pick an answer: it's marked straight away, just as your pupils would see it.
About this resource
AQA A-level Computer Science (7517) 4.3.2.1 Simple tree-traversal algorithms · 4.3.3.1 Reverse Polish: infix transformations. C# lesson 2 of 5 in 4.3 Fundamentals of algorithms: a trace-the-walk Do Now, a short key idea, an 11-challenge ladder in three sets with exact test data, two exam question…
20 slides.
Lesson outline
- Do Now: trace the walk
- Do Now: answers
- Key idea: Three ways to visit every node
- Check: the post-order traversal
- Key idea: Trace it by hand: the dot method
- Key idea: What each traversal is for
- Key idea: Reverse Polish notation (RPN)
- Check: infix to RPN
- Key idea: Evaluating RPN with a stack
- Set 1: three ways round a tree
- Set 2: what the traversals are for
- Exam question E1: traversals
More from 4.3 Algorithms · full C# lessons
- Lesson pack · 4.3 L1Graph traversal: breadth-first and depth-firstSubscription
- Lesson pack · 4.3 L3Searching: linear, binary and binary tree searchSubscription
- Lesson pack · 4.3 L4Sorting: bubble sort and merge sortSubscription
- Lesson pack · 4.3 L5Optimisation: Dijkstra's shortest path algorithmSubscription


