(********************************************************************) (* OCaml code from the book ``Learn Programming with OCaml'' *) (* See https://usr.lmf.cnrs.fr/lpo/ *) (* *) (* Sylvain Conchon and Jean-Christophe Filliâtre *) (* Copyright 2025 Université Paris-Saclay and CNRS *) (* *) (* Openly licensed via CC BY SA 4.0 *) (* See https://creativecommons.org/licenses/by-sa/4.0/deed.en *) (********************************************************************) (* Program 53 on page 251 Searching in a Patricia Tree *) let zero_bit x b = x land b == 0 let rec mem x = function Empty -> false Leaf j -> x = j Node (_, b, l, r) -> mem x (if zero_bit x b then l else r)
This document was generated using caml2html