3 ms·
Actually, you can. As per the article, you can view the skiplist as a tree when turned 1/8th. So you can start at the head, put it on the stack, move to the ne
by sobani 10y ago
Actually, you can. As per the article, you can view the skiplist as a tree when turned 1/8th.
So you can start at the head, put it on the stack, move to the next node referenced at the hightest level, put it on the stack, etc. just like you can start from the top of the tree, put it on the stack, move right, put it on the stack, etc.
The advantage of the skiplist over the tree is that you can traverse forward in O(1) space. But both are equally bad in reverse