Re: [fpc-pascal] How To write an enumerator for trees

2013-03-22 Thread kyan
On Fri, Mar 22, 2013 at 12:39 AM, S. Fisher wrote: > --- On Thu, 3/21/13, kyan wrote: > Are you the man who created Kyan Pascal? I used that many > years ago. I'd never heard of it till now. I wish. I'm nowhere nearly that good. :) ___ fpc-pascal mai

Re: [fpc-pascal] How To write an enumerator for trees

2013-03-21 Thread S. Fisher
--- On Thu, 3/21/13, kyan wrote: > > HTH > > Constantine Are you the man who created Kyan Pascal? I used that many years ago. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How To write an enumerator for trees

2013-03-21 Thread waldo kitty
On 3/21/2013 09:59, Xiangrong Fang wrote: I am not creating a new thread, but just replied it. your post did not contain a references control line pointing to the post you were replying to... that breaks the linking and it won't be placed in the tree... my 2 centavos... My question is abou

Re: [fpc-pascal] How To write an enumerator for trees

2013-03-21 Thread Xiangrong Fang
I am not creating a new thread, but just replied it. My question is about algorithm not syntax. I will try the sample program by Kyan. Thanks. 2013/3/21 Michael Schnell > I have read this. My question is not about how to write enumerator, but >> how to do this for TREEs >> > > Xiangrong Fan

Re: [fpc-pascal] How To write an enumerator for trees

2013-03-21 Thread Michael Schnell
I have read this. My question is not about how to write enumerator, but how to do this for TREEs Xiangrong Fang: Please anser to a message instead of creating a new thread ! There might be no necessary sort order of a tree. So you first need to invent a usable sort order and set up the enumera

Re: [fpc-pascal] How To write an enumerator for trees

2013-03-21 Thread Michael Schnell
On 03/21/2013 04:11 AM, Xiangrong Fang wrote: Now I don't know how to write an enumerator for it. ... Syntax or algorithm ? -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How To write an enumerator for trees

2013-03-21 Thread kyan
On Thu, Mar 21, 2013 at 10:32 AM, Xiangrong Fang wrote: > I have read this. My question is not about how to write enumerator, but how > to do this for TREEs Usually linearizing recursion is done with a stack. Here's a sample implementation that will give you an in-order tree traversal (Left - Par

Re: [fpc-pascal] How To write an enumerator for trees

2013-03-21 Thread Xiangrong Fang
I have read this. My question is not about how to write enumerator, but how to do this for TREEs Thanks 发送自魅族MX 原始邮件 发件人:Mattias Gaertner 时间:3月21日 15:39 周四 收件人:fpc-pascal@lists.freepascal.org 主题:Re: [fpc-pascal] How To write an enumerator for trees >On Thu, 21 Mar 2013

Re: [fpc-pascal] How To write an enumerator for trees

2013-03-21 Thread Mattias Gaertner
On Thu, 21 Mar 2013 11:11:49 +0800 Xiangrong Fang wrote: > Hi, > > I would like to add enumerator support for my TTreap implementation ( > https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas). > > The tree nodes are defined as: > > PNode = ^TNode; > TNode = recor

[fpc-pascal] How To write an enumerator for trees

2013-03-20 Thread Xiangrong Fang
Hi, I would like to add enumerator support for my TTreap implementation ( https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas). The tree nodes are defined as: PNode = ^TNode; TNode = record Count: Cardinal; Key: TKey; Value: TValue;