[SOLVED]
So, I decided to try creating a sorted doubly linked skip list ...
I am sure that I have a good idea of how this works. When you insert x, the program looks for a base list for a suitable place to place x (since it is sorted), (conceptually) flips the coin, and if the “coin” lands on the fact that this element is added to the list above (or a new list is created with by an element in it) associated with the element below it, and the coin flips again, etc. If the “coin” lands on b at any time, then the insert is complete. You should also have -infinite, which is stored in each list as a starting point, so it is impossible to insert a value that is less than the initial one (this means that it can never be found.)
To search for x, you start with the "top left" (the smallest smallest value of the highest list) and "go right" to the next item. If the value is less than x, than you go to the next element, etc., Until you "go too far", and the value is greater than x. In this case, you return to the last element and descend to the level, continuing this chain, until you find x or x, you will never find.
To remove x, you simply look for x and delete it every time it appears in the lists.
For now, I'm just going to make a skip list that stores numbers. I don’t think there is anything in STL that can help me, so I need to create a List class that contains an integer value and has member functions, search, delete and insert.
, , . , "" , , "" ( ?)
- , , :
- .
- , List, , List , . , .
- , int, rand()% 2 0 1, 0, " ", 0, . ?
- , -infinite?
: , List.... , "-infinite" vectorname [0] , .