Rank(int pos) from head or tail adaptively,Rank(int pos,int &bit) is on the way!