tree search

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tomylin
    New Member
    • Aug 2007
    • 4

    #1

    tree search

    how make tree search, if the value of the node is same with the before node then the position is right of the before node.
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Welcome to TSDN. Here is an article that may help:
    ASP.NET Tree Control

    Comment

    • vanc
      Recognized Expert New Member
      • Mar 2007
      • 211

      #3
      Originally posted by tomylin
      how make tree search, if the value of the node is same with the before node then the position is right of the before node.
      What you can do if you want to build this algorithm yourself is you should use recursive function to find to the leaf of the tree.
      e.g.
      TreeSearch(node position)
      if this node is not leaf
      if this node is less than the value
      TreeSearch(left node)
      else
      TreeSearch(righ tnode)
      else //this is the left node then return the node
      return this node

      Above is just the idea of using recursive function if you don't know, but I think you've already known about it, so it's not hard to implement it yourself hey!

      cheer.

      Comment

      Working...