Finding all rationals in a given range using Stern-Brocot tree
I know the Stern-Brocot tree lists out all the possible fractions. But how do I enumerate the fractions that are present in $[a, b]$ where $a$ and $b$ are two fractions.
Repeatedly interleaving mediants (as in the original Stern Brocot tree) should work. See <