Hi Rebols

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?

---------------
/* stack */
struct linked_list {
        char       word[20];
        struct    linked_list  *next;
};
typedef struct linked_list ELEMENT;
typedef ELEMENT            *LINK;

    char s[20];
    LINK head,work;
    head = work = NULL;
...
/* stack insertion */
/* s is the key to be inserted */
    work = (LINK) malloc(sizeof(ELEMENT));
    strcpy(work -> word,s);
    work -> next = head;
    head = work;
...
/* stack deletion */
    work = head -> next;
    free(head);
    head = work;
---------------

Thanks for your advice
Regards


-- 
Luis Marzulli
e-mail: [EMAIL PROTECTED]
Caracas, VENEZUELA
----------------------------------------------------------
Earn money when you or your friends are on the Web
click --> http://www.alladvantage.com/go.asp?refid=BXX890

Reply via email to