From 1df1e1eabc7bab55764d1e145c3b40db7820a419 Mon Sep 17 00:00:00 2001 From: enqidu Date: Tue, 7 Jul 2020 19:58:10 +0400 Subject: [PATCH] improve --- data_structures/skip_list.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/data_structures/skip_list.cpp b/data_structures/skip_list.cpp index eb8e5cd87..25a9aae2a 100644 --- a/data_structures/skip_list.cpp +++ b/data_structures/skip_list.cpp @@ -1,4 +1,4 @@ -/** +/* * A skip list is a data structure that is used for storing a sorted list of items with a * help of hierarchy of linked lists that connect increasingly sparse subsequences of the items * @@ -18,7 +18,7 @@ using std::endl; #define PROBABILITY 0.5 ///< current probability for "coin toss" -/** +/* * Node structure [Key][Node*, Node*...] */ struct Node { @@ -30,7 +30,7 @@ struct Node { Node(int key, int level, void* value); }; -/** +/* * Creates node with provided key, level and value */ Node::Node(int key, int level, void* value) { @@ -42,7 +42,7 @@ Node::Node(int key, int level, void* value) { } } -/** +/* * SkipList class */ class SkipList { @@ -59,7 +59,7 @@ public: }; -/** +/* * Skeep List constructor */ SkipList::SkipList() { @@ -83,7 +83,7 @@ SkipList::~SkipList(){ } -/** +/* * Returns random level for skip list; */ int SkipList::randomLevel() { @@ -94,7 +94,7 @@ int SkipList::randomLevel() { -/** +/* * Inserts elements with given key and value; * It's level is computed by randomLevel() function. */ @@ -135,7 +135,9 @@ void SkipList::insertElement(int key, void* value) { } } - /**Delete document by key*/ +/* + * Delete document by key +*/ void SkipList::deleteElement(int key) { Node *x = header; @@ -166,7 +168,7 @@ void SkipList::deleteElement(int key) } -/** +/* * Searching element in skip list structure */ void* SkipList::searchElement(int key) { @@ -187,7 +189,7 @@ void* SkipList::searchElement(int key) { } } -/** +/* * Display skip list level wise */ void SkipList::displayList() { @@ -204,7 +206,7 @@ void SkipList::displayList() { } -/** +/* * Main function: * Creates and inserts random 2^[number of levels] elements into the skip lists and than displays it */