Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Traversal, preorder, inorder, postorder, breadth-first order?

Dikenal juga sebagai: traversal · preorder · inorder · postorder · breadth-first order

Definition 25.5 High School Computer Science · Bab 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.
Baca dalam konteks →