Implementation In this assignment, you will have to write a quadruply-linked list-based partial implementation of the Li

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Implementation In this assignment, you will have to write a quadruply-linked list-based partial implementation of the Li

Post by answerhappygod »

Implementation In This Assignment You Will Have To Write A Quadruply Linked List Based Partial Implementation Of The Li 1
Implementation In This Assignment You Will Have To Write A Quadruply Linked List Based Partial Implementation Of The Li 1 (145.77 KiB) Viewed 22 times
Implementation In this assignment, you will have to write a quadruply-linked list-based partial implementation of the List interface. Unlike the existing java.util.LinkedList, your implementation will allow for faster traversal of the list. Specifically, the list nodes should contain references to elements ten positions forwards and backwards - if these exist, in addition to the common one position in each direction: AAA ! d d d de Index 0 Index 1 Index 2 Index 3 Index 10 Index 11 Index 12 Figure 1: Illustration of the list you are required to implement. Nodes between indices 4 and 9 are not shown. For clarity, only some of the links are shown. symbols indicate null references, and "d" are user data references.

You may review the following LinkedList implementation as an example how a linked list is implemented in Java (you may not copy or re-use the code from there): https://developer.classpath.org/doc/jav ... ource.html Ultimately, you should implement your class from scratch. Also, you need to ensure the best possible performance for all the implemented operations. E.g., to access the 85th element of a 100-element list, one should not need to access more than six elements in addition to the requested one. Part 1 Implement the following public methods in your implementation of the List interface, called TenLinked List: 1. boolean add (E e) 2. void add (int index, E element) remove(int index) 3. E 4. E get(int index) 5. int size() clear() 6. void 7. String toString() (see Java API: AbstractCollection²) 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., Linked List; please refer to the class API online). For the methods of the interface that you do not need to implement, you may either leave them empty or throw an exception public type some UnneededMethod() { throw new Unsupported Operation Exception(); } Of course, you are free to implement any private or protected methods and classes as you see fit. However, the methods mentioned above (or the ones present in the List interface, or in the class' superclasses) are the only public methods your class should contain. Furthermore, your code should not have any side effects, such as printing to the console.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply