title: The deepest way in tree
body: <p>I have a tree with <code>n</code> elements that store something like <code>|id|parent_id|</code>. I need to find the maximum depth of this tree. I need to do this in Ruby, but pseudo code can help me too.</p>