Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Traversal, preorder, inorder, postorder, breadth-first order?

Ook bekend als: traversal · preorder · inorder · postorder · breadth-first order

Definition 25.5 High School Computer Science · Hoofdstuk 25 — Trees and Binary Search Trees

A traversal of a tree visits each node once. In preorder, a node is visited before its left and right subtrees; in inorder, between them; in postorder, after them. In breadth-first order, nodes are visited level by level, from the root down, from left to right in each level.

The expression (3 + 4) × (5 - 2) as a tree, with its four traversals. In postorder each operator comes after its operands; the values computed at each node are written beside it.
The expression (3+4)×(5−2)(3 + 4) \times (5 - 2) as a tree, with its four traversals. In postorder each operator comes after its operands; the values computed at each node are written beside it.
Lees in het hoofdstuk →