Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Depth, height, size?

Dikenal juga sebagai: depth · height · size

Definition 25.2 High School Computer Science · Bab 25 — Trees and Binary Search Trees

The depth of a node is the number of links from the root to it: the root has depth 00. The height of a tree is the largest depth of its nodes; a tree of one node has height 00, and by convention the empty tree has height −1-1. The size of a tree is its number of nodes.

A tree of size 7 and height 3. A is the root; D, G and F are the leaves (shaded); B is the parent of D and E. The dashed line surrounds the subtree of root B: size 4, height 2.
A tree of size 77 and height 33. A is the root; D, G and F are the leaves (shaded); B is the parent of D and E. The dashed line surrounds the subtree of root B: size 44, height 22.
Baca dalam konteks →