Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Nrite a Java program to implement Single Linked List. The program should be able to orovide options to insert node, delete node, get element and
Nrite a Java program to implement Single Linked List. The program should be able to orovide options to insert node, delete node, get element and size of list. You may use following classes as references: NodeType - class to define node LinkedList - class to represent linked list object Implement following methods: i. void insertAtBeginning(int value) - insert element at the beginning of the list ii. void insertAtEnd(int value) - insert element at the end of the list iii. void insertItemAt(int value, int index) - insert element at given index iv. int getSize () - get the size of list v. int getItemAt(int index)- get element's info at a given index vi. void setItemAt(int value, int index) - set element's info at a given index vii. void deleteFirst () - delete the first element viii. void deleteLast () - delete the last element ix. void deleteItemAt(int index) - delete an element at given index (26 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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