advertisement

Article:
  Scripting a Binary Tree Using Tcl
Subject:   also...
Date:   2005-01-31 13:45:21
From:   belman
Your recursion to populate it is wasteful and doesn't enhance readability. For large trees, better hope you have some stack protection.


A while() that modifies the working pointer and resets it to the root on every element change will most likely be faster, and also be less of a resource hog.


(I'm really not trying to tear this article apart - I'm just hoping someone gets some good tips out of these, it is a helpful article.)

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • also...
    2005-02-01 10:00:08  mnorton [Reply | View]

    hi,

    Thanks. For the info. The example was essentially some through away code to demonstrate the binary tree operation in Tcl.

    You're right on with the while() tip. I wanted the example code to be more explicit in the operation of the tree.

    Mike