<span style="font-family:courier new,monospace">Hi,<br><br>I would like to add enumerator support for my TTreap implementation (<a href="https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas">https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas</a>).<br>
<br>The tree nodes are defined as:<br><br> PNode = ^TNode;<br> TNode = record<br> Count: Cardinal;<br> Key: TKey;<br> Value: TValue;<br> Priority: Cardinal;<br> Left, Right: PNode;<br>
end;</span><br><span style="font-family:courier new,monospace"><br>Now I don't know how to write an enumerator for it. I would like to traverse the tree "In-Order", either from the left-most node or from the right-most node, so that I can output nodes like:<br>
<br> for n in MyTreap do WriteLn(n^.Key);<br><br>Thanks.</span><br>