add class BidirectionIndex.
this can be used as an O(1) implementation of set<int>, when the integers are aggregate in certain range. for example, vertex set in topological graph.