code: public Node getRoot(Node node)
    {
  
      Node root = null;
  
      while (node != null)
      {
        root = node;
        node = getParentOfNode(node);
      }
  
      return root;
    }
docs: Get the first unparented node in the ancestor chain.
  @deprecated
  
  @param node Starting node, to specify which chain to chase
  
  @return the topmost ancestor.