skip-list documentation-polish

This commit is contained in:
enqidu 2020-07-07 17:24:13 +04:00
parent 5068ddc14d
commit dcdebae395

View File

@ -54,7 +54,10 @@ public:
void deleteElement(int);
void* searchElement(int);
void displayList();
~SkipList();
};
SkipList::SkipList() {
level = 0;
@ -63,6 +66,18 @@ SkipList::SkipList() {
}
SkipList::~SkipList(){
delete header;
for(int i=0; i <= level; i++) {
Node *node = header->forward[i];
Node* temp;
while(node != NULL) {
temp = node;
node = node->forward[i];
delete temp;
}
}
}
/**