Answered step by step
Verified Expert Solution
Link Copied!

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

2.17 LAB: Singly-Linked 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 linked-list implementation to provide the following functionality:
Append
Add an integer to the end of current linked-list
Insert
Add an integer at the requested index.
Get
Return the value at the requested location, or 0 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 linked-list.
Close the gap in the linked-list.
Return true if the item was removed and false if it was not (i.e. not found).
DeleteAt
Remove the value at the position requested in the current linked-list.
Close the gap in the linked-list.
Return true if the item was removed and false if it was not (i.e. 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.2.17 LAB: Singly-Linked 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 linked-list implementation to provide the following functionality:
Append
Add an integer to the end of current linked-list
Insert
Add an integer at the requested index.
Get
Return the value at the requested location, or 0 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 linked-list.
Close the gap in the linked-list.
Return true if the item was removed and false if it was not (i.e. not found).
DeleteAt
Remove the value at the position requested in the current linked-list.
Close the gap in the linked-list.
Return true if the item was removed and false if it was not (i.e. 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.
image text in transcribed

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

Database Theory And Application Bio Science And Bio Technology International Conferences DTA And BSBT 2011 Held As Part Of The Future Generation In Computer And Information Science 258

Authors: Tai-hoon Kim ,Hojjat Adeli ,Alfredo Cuzzocrea ,Tughrul Arslan ,Yanchun Zhang ,Jianhua Ma ,Kyo-il Chung ,Siti Mariyam ,Xiaofeng Song

2011th Edition

3642271561, 978-3642271564

More Books

Students also viewed these Databases questions