=================================== Skip Lists Final Project =================================== Why Skip Lists ==================== I was at first intriqued by skiplists by reading the chapter but I was still left with a lot of questions and a little bit of confusion on how the jumping or skipping would work. I watched some youtube videos further explaining the data structures I have included the notes from those videos below, under video notes. First step will be mapping out my timeline and steps to the Project Steps ==================== 1. Watch Videos and Take notes 2. Compare Notes to the textbook and finalize a completed note sheet 3. Research Ideas for how to use a skip lists in a cool Project 4. Create the basic management system of the Skip List Data structure 5. Create a point system for the explorer game 6. Implement the search list into the explorer game Video Notes ============= Searching ------------ In this example you are searching for 50. You start at the most upper left node and begin by searching down. Throughout the search you see a stair step search process form until you reach your target .. code-block:: python skipSearch(50): node = start while node.getBelow()! null node = node.getBelow() while node.getNext.getKey() <= 50 node = node.getNext() return node When searching for something that doesn't exist it will return the largest node <= the data you are searching for Insertion ------------- In this example we are inserting the key of 42 1. Search for the largest key <= 42 (which will then be returned by the search method) 2. Insert the new node 3. Manipulate the refrences for the new inserted node 4. Keep inserting the node on the tower until the coin flip returns tails Deletion ----------- 1. Search for the node you want to delete 2. Remove the node 3. Manipulate the horizontal refrences Project Implementation =========================== * Leaderboard system * Features: * Add player score * Update score * store the data on the hardrive (search for ideas on how best to store) * Implement into the last project Skip List Code ========================= .. attention:: This is just the skip list management system. You can see how the insert, search and delete functions work. .. literalinclude:: skip_lists.cpp :language: cpp Original game ============================== .. attention:: This is a game that I made for the first project. This game is about exploring regions. I will be implementing a point system and using the skip lists as a leaderboard for the players scores. .. literalinclude:: explore.cpp :language: cpp Final Project ==================== .. attention:: There are 3 files for the final version. This includes the skiplist.cpp file which houses all the logic for the skiplist, the Skiplist.h which houses the method declarations for the skiplist so that I can include it into the game, and finally main.cpp which is the orignal game with the addition of the point system. Skiplist.h -------------- .. literalinclude:: complete/Skiplist.h :language: cpp skiplist.cpp -------------- .. literalinclude:: complete/skiplist.cpp :language: cpp Main -------------- .. literalinclude:: complete/main.cpp :language: cpp Leaderboard --------------- .. attention:: This is what the leaderboard text file looks like which drives the system by being able to store data over time .. literalinclude:: complete/leaderboard.txt :language: txt