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.




Current file: main.cpp Load default template.. 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
