Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
2. Write a Java method which inserts a positive integer at the end of a linked list. 3. Write a Java method which displays the
2. Write a Java method which inserts a positive integer at the end of a linked list. 3. Write a Java method which displays the elements of a linked list. 4. Write a Java method which returns true if a given integer X is in a linked list and false otherwise. 5. Write a Java method which returns the size of a linked list. 6. Write a Java method which calculates and returns the sum of elements in a linked list. 7. Write a Java method which calculates and returns the average of elements in a linked list. 8. Write a Java method which divides a linked list L into two linked lists LD and LU. LD will contain the elements that are less or equal than the average of elements of the linked list L and LU will contain the elements that are greater than the average of elements of the linked list L. The elements must be added in each linked list LD and LU without duplication 9. Write a main method, which you call the above methods to : a. Create a linked list L of N integers. b. Divide the linked list L into two linked list LD and LU. c. Display the elements of two obtained linked list LD and LU
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started