News for hackers. Stuff that matters.
Re:Getting a job in software development: A Reddit discussio... by kd5bjo on Sunday December 11, 2011 @10:31AM (#3340215)
Start at the root of the tree; at each node:

  - If the node value matches, return it
  - If the node value is too low:
    - If possible, step right and repeat
    - Otherwise, return this node value
  - If the node value is too high:
    - If possible, step left and repeat
    - Otherwise, return the value of this node's predecessor:
      - Walk up until you traverse a right link
      - Return the node's value
      - If you hit the root, the requested value is less than any value in the tree

There are no comments on this comment yet.