Question: Project 2: Singly-Linked List The purpose of this assignment is to assess your ability to: Implement sequential search algorithms for linked list structures Implement sequential
Project 2: Singly-Linked List
The purpose of this assignment is to assess your ability to:
- Implement sequential search algorithms for linked list structures
- Implement sequential abstract data types using linked data
- Analyze and compare algorithms for efficiency using Big-O notation
For this assignment, you will implement a singly-linked node class. Use your singly-linked node to implement a singly-linked list class that maintains its elements in ascending order.
The SinglyLinkedList class is defined by the following data:
- A node pointer to the front and the tail of the list
Implement the following methods in your class:
- A default constructor list myList
- A copy constructor list myList(aList)
- Access to first element myList.front()
- Access to last element myList.back()
- Insert value myList.insert(val)
- Remove value at front myList.pop_front()
- Remove value at tail myList.pop_back()
- Determine if empty myList.empty()
- Return # of elements myList.size()
- Reverse order of elements in list myList.reverse()
- Merge with another ordered list myList.merge(aList)
Write a thorough test program for this class. THIS ASSIGNMENT MUST BE WRITTEN IN JAVA.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
