Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Compare operations for Javas ArrayList and LinkedList. Measure times while doing multiple read, write and delete operations. Compare with 100,500 and 1000 operations. Submit code

image text in transcribed
image text in transcribed
Compare operations for Javas ArrayList and LinkedList. Measure times while doing multiple read, write and delete operations. Compare with 100,500 and 1000 operations. Submit code and your results in codes comments. 2. Create a list structure where you can add elements to the beginning of list and to the end of list and get element from spesific location. Write your implementation based on either ArrayList or LinkedList. You are not allowed to use Javas List structures. List is empty in the beginning. When you add elements, they are indexed from 0,1,2,3,4 Create class OwnList with methods: void addToBeginning(int x ) // adds x to the beginning void addToEnd(int x ) // adds x to end int getElement(int k) // fetches element from index k void wedge(int index, int x ) // Add element to spesific index and increments other elements indexes 3. See LinkedIn Learning video of doubly linked list and implement insertion sort to it. 4. Implement following functionality to singleLinkedList or your arraylist made in task 2. You have a linked list that contains n integers in its nodes values. Iterate through linked list removing consecutive nodes where integers has the same number. If there are multiple ways to remove nodes, remove the leftiest node. How many nodes will remain? [1,2,2,3,3,1]>[1,3,3,1]>[1,1]>[] returns 0 [1,2,3,4,5,6] returns 6 [1,2,3,2,2,1]>[1,2,3,1] returns 4 [1,2,2,2,3,1]>[1,2,3,1] returns 4

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

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

Find the value of the number C: cos x + C = cos(2x) 4

Answered: 1 week ago

Question

In 1969 stonewall inn uprising launched the

Answered: 1 week ago

Question

Describe how to train managers to coach employees. page 404

Answered: 1 week ago

Question

Discuss the steps in the development planning process. page 381

Answered: 1 week ago