AQA A-level Computer Science (7517)Specification point 4.3.2.1

AQA 7517 4.3.2.1: Simple tree-traversal algorithms

The free BugBot lesson that teach this point, a robot to try it on, and the past-paper questions that test it.

What it covers

Breadth-first and depth-first traversal visit every vertex of a graph. A binary tree has three standard depth-first orders of its own, and each has its uses: printing a binary search tree in order, copying a tree, turning an expression into Reverse Polish notation. The three differ in only one thing: when each node is visited.

  • Three orders
  • The outline method
  • What each traversal is for
  • Expression trees
  • Breadth-first on a tree
Read the free lesson (25 min)

Or do it in the simulator, with tasks that mark themselves

Lessons that teach it

  1. A4.7 Tree traversals Trees and graphs
    Pre-order, in-order and post-order, the outline method, expression trees and what each traversal is for.

Try it on a robot

The task from A4.7 Tree traversals, running here. Change the program and press Run.

The specification is AQA's own document; this page says which of our lessons teach point 4.3.2.1 and is not endorsed by the board.