answersLogoWhite

0

What is a twalk?

User Avatar

Anonymous

15y ago
Updated: 8/16/2019

This term can mean several things:

  • walking and talking on your phone at the same time
  • online stalking of someone by following their Twitter page
  • a Linux command

twalk performs depth-first, left-to-right traversal of a binary tree. root points to the starting node for the traversal. If that node is not the root, then only part of the tree will be visited. twalk calls the user function actioneach time a node is visited (that is, three times for an internal node, and once for a leaf). action, in turn, takes three arguments. The first is a pointer to the node being visited. The second is an integer which takes on the values preorder, postorder, and endorder depending on whether this is the first, second, or third visit to the internal node, or leaf if it is the single visit to a leaf node. The third argument is the depth of the node, with zero being the root.
User Avatar

Wiki User

15y ago

What else can I help you with?