title: Node depth based on pre, post, and in order number in a binary tree
body: <p>I have a binary tree where each node has a number that stores which place that node comes in for pre, post, and in order traversal.</p>
  
  <p>This image that I found on google images illustrates what I mean:</p>
  
  <p><a href="https://i.stack.imgur.com/c6phA.gif" rel="nofollow noreferrer">https://i.stack.imgur.com/c6phA.gif</a></p>
  
  <p>The problem I am having trouble figuring out is determining the depth (distance from the root) of a node based on its pre, post, and in order numbers in constant time.</p>
  
  <p>Any help or ideas with this problem would be much appreciated.</p>
  
  <p>Thanks. </p>