Quoting [EMAIL PROTECTED] ([EMAIL PROTECTED]):
> I need some help about recursive data structures (stacks, queues, trees, etc)
> Which is the best method in Rebol for the creation and manipulation of
> these structures?
>
> Example:
> The following is a simple C code for insertion and deletion of stack elements.
> How can be rewritten in REBOL?
Why would you want to implement a linked list in REBOL, when there are
integrated types BLOCK and LIST. So an easy implementation of stack or
queue is just to manipulate a BLOCK. I see no need to reimplement a
linked list, you probably wouldn't come even close to the native
implementation of LIST or BLOCK.
If you want to have a binary tree you can implement it as nested
BLOCKs. For example following tree
1
/ \
2 3
/ \
4 5
can be expressed as [1 [2 4 5] 3] (that's
[value left-sub-tree right-sub-tree]). Functions to manipulate it
should be quite straightforward to implement (Haven't tried :).
Yours,
Jussi
--
Jussi Hagman CS in �bo Akademi
Studentbyn 4 D 33 [EMAIL PROTECTED]
20540 �bo [EMAIL PROTECTED]
Finland