mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
skip-list documentation-polish
This commit is contained in:
parent
5068ddc14d
commit
dcdebae395
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user