<div dir="ltr"><div>More exciting (if ML is your thing) news:</div><div>when I reinstituted the call for mem x,</div><div>let rec mem x = function<br> Leaf -> false<br> | Node (_, y, left, right) -><br> x = y || (x < y && mem x left) || (x > y && mem x right)<br> ;;</div><div>emptied the tree, re-loaded the 5,000 or so of 10,000 unsorted numbers I got this:</div><div># mem 7178 s;;<br>- : bool = true<br># mem 285 s;;<br>- : bool = true<br># mem 6009 s;;<br>- : bool = true<br># mem 6008 s;;<br>- : bool = false</div><div><br></div><div>6008 is in the chopped out section of the original 10,000. OCaml reads this list of int's in the blink of an eye; the entire list!</div><div>Jonathan Engwall<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 4, 2021 at 12:53 PM Jonathan Engwall <<a href="mailto:engwalljonathanthereal@gmail.com">engwalljonathanthereal@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hello Beowulf,<div dir="auto">After this brief OCaml video <a href="https://youtu.be/a3kVJKt9mq4" target="_blank">https://youtu.be/a3kVJKt9mq4</a> I created a larger data set one with 5,000 of 10,000 numbers sequenced randomly. It illuminates the workings of RED BLACK binary tree.</div><div dir="auto"><br></div><div dir="auto">Simply copy&paste (ctrl k ctrl v) the large set to the command line. OCaml immediately builds several BLACK root nodes searching for a "balance point."</div><div dir="auto">I give a link to the RED BLACK implementation and larger data set. My source receives credit as well.</div><div dir="auto"><br></div><div dir="auto">Earlier experience with simple routines like fibonacci have me worried that OCaml is slow, RED BLACK's all short branches look quite fast.</div><div dir="auto"><br></div><div dir="auto">Jonathan Engwall</div></div>
</blockquote></div>