Class LCATree


  • public class LCATree
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LCATree​(int capacity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int addNode​(int parent)  
      int depthOf​(int node)  
      int lcaOf​(int a, int b)  
      int parentOf​(int node)  
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LCATree

        public LCATree​(int capacity)
    • Method Detail

      • size

        public int size()
      • addNode

        public int addNode​(int parent)
      • parentOf

        public int parentOf​(int node)
      • depthOf

        public int depthOf​(int node)
      • lcaOf

        public int lcaOf​(int a,
                         int b)