Allows insertions and lookups in O(logn) time