Skip List Needs Implemented Java Implement Class Nodeskiplist Two Components Namely Key No Q43859489
Skip list, needs to be implemented in Java:
– Implement the class NodeSkipList with two components, namelykey node and array of successors. You can also add a constructor,but you do not need to add any method. – In the class SkipListimplement a constructor SkipList(long maxNodes).
The parameter maxNodes determines the maximal number of nodesthat can be added to a skip list. Using this parameter we candetermine the maximal height of a node, that is, the maximal lengthof the array of successors.
As the maximal height of a node it is usually taken thelogarithm of the parameter. Further, it is useful to construct bothsentinels of maximal height.
– In the class SkipList it is useful to write a method whichsimulates coin flip and returns the number of all tosses until thefirst head comes up. This number represents the height of a node tobe inserted.
2 – In the class SkipList implement the following methods:
(i) insert, which accepts an integer and inserts it into a skiplist. The method returns true, if the element is successfullyinserted and false, if the element already exists in the datastructure.
(ii) search, which accepts an integer and finds it in a skiplist. The method returns true, if the element is successfully foundand false otherwise.
(iii) delete, which accepts an integer and deletes it from askip list. The method returns true, if the element is successfullydeleted and false otherwise.
Expert Answer
Answer to Skip list, needs to be implemented in Java: – Implement the class NodeSkipList with two components, namely key node and …
OR