Is there any Red Black Tree /AVL Tree data structure implementation in Java collections/Guava/Apache Commons library ? If yes , can you point them to me . Basically I am looking for a data structure where the queries should happen in O(lg n) time . There will also be some updates to the data structure but not quite as often as the queries.
Is there any Red Black Tree / AVL Tree data structure implementation in Java
Share
Use a TreeMap. It is backed by a Red-Black tree so it’s access time is
O(logN)(my emphasis on quote bellow)