Apply concepts of Advanced Data Structures to implement a template class for singly linked list with following attributes and functionalities: template struct Node{ T Data; Node *nextPtr; }; class...


Apply concepts of Advanced Data Structures to implement a template class for singly
linked 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 to
the list. Move the first two elements in the list to last, move the element from the
middle to the start and display the linked list.



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here