This commit is contained in:
Simon Cruanes 2025-05-01 13:32:37 -04:00
parent 6e2d11384b
commit 90311ad4fa
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 8 additions and 8 deletions

View file

@ -22,10 +22,10 @@ open struct
| E -> 0 | E -> 0
| N (r, _, _, _) -> r | N (r, _, _, _) -> r
(** Make a balanced node labelled with [x], and subtrees [a] and [b]. (** Make a balanced node labelled with [x], and subtrees [a] and [b]. We
We ensure that the right child's rank is to the rank of the ensure that the right child's rank is to the rank of the left child
left child (leftist property). The rank of the resulting node (leftist property). The rank of the resulting node is the length of the
is the length of the rightmost path. *) rightmost path. *)
let[@inline] mk_node_ x a b = let[@inline] mk_node_ x a b =
if rank_ a >= rank_ b then if rank_ a >= rank_ b then
N (rank_ b + 1, x, a, b) N (rank_ b + 1, x, a, b)

View file

@ -22,10 +22,10 @@ open struct
| E -> 0 | E -> 0
| N (r, _, _, _) -> r | N (r, _, _, _) -> r
(** Make a balanced node labelled with [x], and subtrees [a] and [b]. (** Make a balanced node labelled with [x], and subtrees [a] and [b]. We
We ensure that the right child's rank is to the rank of the ensure that the right child's rank is to the rank of the left child
left child (leftist property). The rank of the resulting node (leftist property). The rank of the resulting node is the length of the
is the length of the rightmost path. *) rightmost path. *)
let[@inline] mk_node_ x a b = let[@inline] mk_node_ x a b =
if rank_ a >= rank_ b then if rank_ a >= rank_ b then
N (rank_ b + 1, x, a, b) N (rank_ b + 1, x, a, b)