0001 template <typename T> TowerPosi<T> Skiplist<T>::search(const T& e) { 0002 _x = head; //从head塔的顶层出发 0003 for (Rank h = height(_x) - 1; -1 != h; h--) //逐层下降,直至底层 0004 while ((tower(_x)[h].succ != tail) && (key(tower(_x)[h].succ) <= e)) //在每一层 0005 _x = tower(_x)[h].succ; //都尽可能地右移 0006 return _x == head ? nullptr : _x; //最终止步于不大于e的最后一座塔 0007 } //search