Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the following public methods in your implementation of the List interface, called SkipList: 1. boolean add(E e) 2. void add(int index, E element) 3.

image text in transcribed
Implement the following public methods in your implementation of the List interface, called SkipList: 1. boolean add(E e) 2. void add(int index, E element) 3. E remove(int index) 4. E get (int index) One public constructor should exist in your implementation: one that takes no parameters and creates an empty list when the class is instantiated. The class should use generics. The behaviour of the methods in your implementation should be equivalent to that of Java Standard Library's classes (e.g., ArrayList; please refer to the class API online). For the remaining methods of the interface, you may just throw an exception public type someUnneededMethod() { throw new UnsupportedOperationException(); ) Of course, you are free to implement any private or protected methods and classes as you see fit. However, you may not have any public methods other than the ones mentioned (or the ones present in the interface or class' superclass). Implement the following public methods in your implementation of the List interface, called SkipList: 1. boolean add(E e) 2. void add(int index, E element) 3. E remove(int index) 4. E get (int index) One public constructor should exist in your implementation: one that takes no parameters and creates an empty list when the class is instantiated. The class should use generics. The behaviour of the methods in your implementation should be equivalent to that of Java Standard Library's classes (e.g., ArrayList; please refer to the class API online). For the remaining methods of the interface, you may just throw an exception public type someUnneededMethod() { throw new UnsupportedOperationException(); ) Of course, you are free to implement any private or protected methods and classes as you see fit. However, you may not have any public methods other than the ones mentioned (or the ones present in the interface or class' superclass)

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions