Seamless Made Fun of My Dead Cat and Now It's Merging with GrubHub
-
Seamless and GrubHub, two nearly identical online food-ordering companies
whose business model consists of providing a service that is already
available ...
9 minutes ago
The right grammar should be that "skip lists are a ..."
ReplyDeletemore precisely: "are an interesting"
ReplyDeleteif ((tk == 0) || // null?
ReplyDelete( key < tk->key_)) // search key < next level link's key
Is not correct. C++ does not guarantee left to right evaluation and so this may result in a segmentation fault depending on the compiler.
@anonymous:
ReplyDeleteof course it does for && and ||: it is called shortcut evaluation, and test for null OR dereference is idiomatic both in C and C++.
I believe you have a bug in your search__ function:
ReplyDeleteif ((x == 0)) ||
(key < x->val_))
Shouldn't this read:
if ((x == 0)) ||
(key < x->key_))
?