Implement class “LinkedList” which has two private data members
head: A pointer to the Node class
length: length of the linked list
// Node* GetNode(int index) const;
A private function which is only accessible to the class methods. This function takes an array-like index and returns the address of the node at that index. For example, index 0 corresponds to the head and index length-1 corresponds to end node of the linked list. The function returns NULL if the index is out of bound.//
Implement the following public method:
1. bool RemoveHead();// Use RemoveAt Function
Remove first node. Return true if successful, otherwise, false.
2. bool RemoveEnd();// Use RemoveAt Function
Remove last node. Return true if successful, otherwise, false.
3 . void DisplayList() const;
Display data of the whole linked list
this in c++.
Step by step
Solved in 3 steps with 1 images