Apply concepts of Advanced Data Structures to implement a template class for singlylinked list with following attributes and functionalities:template struct Node{T Data;Node *nextPtr;};class LinkedList{private:int Length;Node *headPtr;public:LinkedList();~LinkedList();int getLength();void insertNode(T);void removeNode(T);void MovetoLast(int index);void MovetoStart(int index);void DisplayList();};Page 3 of 3- insertNode(T) will insert a new node at the start of the list- Function removeNode( T) will search a node and if found, delete it from the list.- Copy Constructor: Copy Constructor will make a copy of an existing Linked List- MovetoLast (int index ) will move a node from an index to the end of the list.- MovetoStart (int index ) will move a node from an index to the start of the list.- In main(), create a linked lists of type float and ask the user to add 10 values tothe list. Move the first two elements in the list to last, move the element from themiddle to the start and display the linked list.
Page 3 of 3
- insertNode(T) will insert a new node at the start of the list- Function removeNode( T) will search a node and if found, delete it from the list.- Copy Constructor: Copy Constructor will make a copy of an existing Linked List- MovetoLast (int index ) will move a node from an index to the end of the list.- MovetoStart (int index ) will move a node from an index to the start of the list.- In main(), create a linked lists of type float and ask the user to add 10 values tothe list. Move the first two elements in the list to last, move the element from themiddle to the start and display the linked list.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here