An in-order walk reads keys in sorted order.

highlighted = computed this step

Ordered scan reads in order

Search follows one path, but an ordered scan walks the tree in key order. The scan result is recomputed from the compiled tree, then rendered as a sequence. Note: the sequence appears only in the diagram.

in order scan\text{in order scan}

Tree source

The source tree has recomputed height 2 and key count 9. Note: the same compiled tree feeds the scan.

h=2,k=9h=2,\quad k=9

a page models a node; real B-trees tune fanout to disk pages; tiny exact trees prove structure/search behavior only - no I/O or perf claims.

B-tree pages205070n010n13040n260n38090n4

Rendered scan

The recomputed scan emits 9 keys. Note: the render shows the sorted sequence without prose hand-typing it.

scan keys=9\text{scan keys}=9

a page models a node; real B-trees tune fanout to disk pages; tiny exact trees prove structure/search behavior only - no I/O or perf claims.

Ordered scan - in-order scan; keys=9102030405060708090

Summary

An ordered scan is deterministic because it is an in-order walk of the recomputed tree. Note: a page models a node; real B-trees tune fanout to disk; no I/O or perf claims.

scan summary\text{scan summary}