Function compute_height

Source
fn compute_height(x: usize) -> usize
Expand description

Computes the height in the implicit binary tree for a 1-indexed position x.

This walks left in the implicit perfect binary tree until reaching a peak (2^k - 1) and returns k - 1.