Question: The objective of this assignment is to implement several basic methods for a singly linked list. I have provided declaration files for the Node and

The objective of this assignment is to implement several basic methods for a singly linked list. I have provided declaration files for the Node and LinkedList classes. ( see node.h and linkedlist.h ).

Implement the following LinkedList methods in linkedlist.cpp:

void add ( int N ) Add N to the front of the linked list.

bool remove ( int N ) Remove the first instance of N from the list, then return true. If the N was not found, return false.

int find ( int N ) Find the first instance of N in the list and return its index. Return -1 if N was not found.

int count ( int N ) Return a count of the instances of N in the list.

int at ( int N ) Return the value stored in the node at index N.

int len() Return the current length of the list.

You can use main.cpp for your own internal testing. Make sure you do not alter the order of elements in the list.

The objective of this assignment is to implement several basic methods for

a singly linked list. I have provided declaration files for the Node

and LinkedList classes. ( see node.h and linkedlist.h ). Implement the following

LinkedList methods in linkedlist.cpp: void add ( int N ) Add N

Do NOT make any changes to node.h file or the linkedlist.h file

Current file: main.cpp 1 #include 2 #include "linkedlist.h" 3 using namespace std; 4 5 int main() 7Test your implementation here *

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!