MacDevCenter.com: Scripting a Binary Tree Using Tcl: "Scripting a Binary Tree Using Tcl"
In C, a binary tree is coded using a struct with a data element and two pointers: a left child pointer and a right child pointer. It would look something like this:
struct node {
int element
node* leftChildPtr
node* rightChildPtr
}
The challenge here is to determine if the Tcl extensions packages provide us with the right bricks we need to meet the task. After dumping the Tcl bricks on the floor, I saw the keyed list extensions. Bingo! If you are unfamiliar with Tcl keyed lists. you may want to check out a previous article, "Playing with Keyed Lists on Mac OS X Tcl/Tk Aqua," on the Mac DevCenter. Please note that Apple currently ships the Tcl extension Expect installed in OS X. If you don't have Tcl/Tk Aqua, you can play along in a UNIX terminal window using the Expect interpreter.
Monday, January 31, 2005
Subscribe to:
Post Comments (Atom)
Popular Posts
- Using QCLRDTAQ to clear data queues in CL and RPG
- UDATE and *DATE in AS400 RPG
- AS400 Job Scheduler
- ibm as400 manuals v5r4
- Creating an as400 Query
- Adobe Flex 2.0 Beta
- Encrypt Data on as400 (QC3ENCDT, Qc3EncryptData)
- IBM WebSphere Developer Technical Journal: Maintain continuous availability while updating WebSphere Application Server enterprise applications
- Recover or reset QSECOFR passwords
- Using as400 QRCVDTAQ api to retrieve a message / entry from a dataqueue
No comments:
Post a Comment