. As each vertex has two children, the Calkin–Wilf tree is a binary tree. However, it is not a binary search tree: its inorder does not coincide with the sorted order of its vertices. However, it is closely related to a different binary search tree on the same set of vertices, the Stern–Brocot tree: the vertices at each level of the two trees coincide, and are related to each other by a bit-reversal permutation. Breadth first traversal The Calkin–Wilf sequence is the sequence of rational numbers generated by a breadth-first traversal of the Calkin–Wilf tree, , , , , , , , , , , , , , , …. Because the Calkin–Wilf tree contains every positive rational number exactly once, so does this sequence. The denominator of each fraction equals the numerator of the next fraction in the sequence. The Calkin–Wilf sequence can also be generated directly by the formula where denotes the th number in the sequence, starting from , and represents the integral part. It's also possible to calculate directly from the run-length encoding of the binary representation of : the number of consecutive 1s starting from the least significant bit, then the number of consecutive 0s starting from the first block of 1s, and so on. The sequence of numbers generated in this way gives the continued fraction representation of .Example: i = 1081 = 100001110012: The continued fraction is [1;2,3,4,1] hence . i = 1990 = 111110001102: The continued fraction is [0;1,2,3,5] hence . In the other direction, using the continued fraction of any as the run-length encoding of a binary number gives back itself. Example: : The continued fraction is [0;1,3] hence = 11102 = 14. : The continued fraction is [1;3]. But to use this method, the length of the continued fraction must be an odd number. So [1;3] should be replaced by the equivalent continued fraction [1;2,1]. Hence = 10012 = 9. A similar conversion between run-length-encoded binary numbers and continued fractions can also be used to evaluate Minkowski's question mark function; however, in the Calkin–Wilf tree the binary numbers are integers (positions in the breadth-first traversal) while in the question mark function they are real numbers between 0 and 1. Stern's diatomic sequence Stern's diatomic sequence is the integer sequence 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, … . Using zero-based numbering,