Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I NEED HELP WITH MY CODE!!! It is not giving the correct output. I attached a screenshot of the description I used for my code,

I NEED HELP WITH MY CODE!!! It is not giving the correct output. I attached a screenshot of the description I used for my code, and then below is my code (SkipList.java and SkipListDriver.java). Below this is an input that is not providing the expected output. Please help!

image text in transcribed
Project Description: Implement the following operations of skip lists, following the algorithms discussed in class. Starter code is provided. A driver program is also provided. Sample inputs and outputs will be provided. Do not change the signatures of methods declared to be public. You can add additional fields, nested classes, and methods as needed. Do not create additional source files. Place all code in SkipList.java. * add(x): Add a new element X to the list. If x already exists in the skip list, replace it and return false. Otherwise, insert x into the skip list and return true. * ceiling(x): Find smallest element that is greater or equal to x. * contains(x): Does list contain x? * first(): Return first element of list. * floor(x): Find largest element that is less than or equal to x. * get(n): Return element at index n of list. First element is at index 0. * isEmpty(): Is the list empty? * iterator(): Iterator for going through the elements of list in sorted order. * last(): Return last element of list. * remove(x): Remove x from the list. If successful, removed element is returned. Otherwise, return null. * size(): Return the number of elements in the list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Unity From Zero To Proficiency Beginner A Step By Step Guide To Coding Your First Game

Authors: Patrick Felicia

1st Edition

1091872023, 978-1091872028

More Books

Students also viewed these Programming questions

Question

sin u / 2 = - 1 - cos u / 2 When u is in the second quadrant.

Answered: 1 week ago