Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 . 1 7 LAB: Singly - Linked Lists A list is an ordered collection of items that supports a number of operations around adding
LAB: SinglyLinked Lists
A list is an ordered collection of items that supports a number of operations around adding items to removing items from, and getting items from the collection. We would like to create a class that uses a linkedlist implementation to provide the following functionality:
Append
Add an integer to the end of current linkedlist
Insert
Add an integer at the requested index.
Get
Return the value at the requested location, or if the location does not exist.
Find
Return true if the value is in linked list, false if it is not.
IsEmpty
Return a bool value indicating if the list is currently empty
Print
Print the current list in order, with an arrow between each item and a new line at the end.
Delete
Remove the first occurrence of the requested item in the current linkedlist.
Close the gap in the linkedlist.
Return true if the item was removed and false if it was not ie not found
DeleteAt
Remove the value at the position requested in the current linkedlist.
Close the gap in the linkedlist.
Return true if the item was removed and false if it was not ie out of range
Size
Return the current number of items in the list as an integer.
Complete the class LinkedList by implementing the required functionality in LinkedList.h The unit tests will directly test the methods in your class.
Note: You must use a linked list implementation to hold the data items You must dynamically allocate Nodes. You may not use Vectors for this lab.
This linked list is not a template class LAB: SinglyLinked Lists
A list is an ordered collection of items that supports a number of operations around adding items to removing items from, and getting
items from the collection. We would like to create a class that uses a linkedlist implementation to provide the following functionality:
Append
Add an integer to the end of current linkedlist
Insert
Add an integer at the requested index.
Get
Return the value at the requested location, or if the location does not exist.
Find
Return true if the value is in linked list, false if it is not.
IsEmpty
Return a bool value indicating if the list is currently empty
Print
Print the current list in order, with an arrow between each item and a new line at the end.
Delete
Remove the first occurrence of the requested item in the current linkedlist.
Close the gap in the linkedlist.
Return true if the item was removed and false if it was not ie not found
DeleteAt
Remove the value at the position requested in the current linkedlist.
Close the gap in the linkedlist.
Return true if the item was removed and false if it was not ie out of range
Size
Return the current number of items in the list as an integer.
Complete the class LinkedList by implementing the required functionality in LinkedList. The unit tests will directly test the methods in your
class.
Note: You must use a linked list implementation to hold the data items You must dynamically allocate Nodes. You may not use Vectors
for this lab.
This linked list is not a template class.
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