GetByRank returns the node at given rank. Note that the rank is 1-based integer. Rank 1 means the first node; Rank -1 means the last node. If remove is true, the returned nodes are removed If node is not found at specific rank, nil is returned. Time complexity of this method is : O(log(N)).
(rank int, remove bool)
| 757 | // |
| 758 | // Time complexity of this method is : O(log(N)). |
| 759 | func (sl *SkipList) GetByRank(rank int, remove bool) *SkipListNode { |
| 760 | nodes := sl.GetByRankRange(rank, rank, remove) |
| 761 | if len(nodes) == 1 { |
| 762 | return nodes[0] |
| 763 | } |
| 764 | return nil |
| 765 | } |
| 766 | |
| 767 | // GetByValue returns the node at given key. |
| 768 | // If node is not found, nil is returned |
nothing calls this directly
no test coverage detected