Question: ii) The Class Interface of a linked list node and a linked list are provided below. Class Interface of Linked List Node class listnode {


ii) The Class Interface of a linked list node and a linked list are provided below. Class Interface of Linked List Node class listnode { private: int value; listnode* next; public: listnode(); listnode (int x); void setvalue (int x); int getvalue(); void setnext (listnode *nextnode); listnode* getnext(); -listnode(); Class Interface of Linked List class linkedlist { private: listnode* root; public: linkedlist(); listnode* get_head(); bool emptylist(); void addlistbegin (listnode *temp); void addlistend (listnode *temp); void addlistorder (listnode *temp); void displayall(); int listcount(); listnode* searchlist(int item); void deletenode (int item); 1 Kindly refer to the above Class Interfaces and answer the following questions: V. i. What is a constructor? ii. Identify two constructors from above. iii. Differentiate between public and private class members. iv. What is meant by encapsulation? Explain the concept of function overloading. vi. Identity a function overloading from above. vii. Identify a destructor. viii. Write the implementation of the following function prototypes: a) listnode (int x); b) void setvalue (int x); c) listnode* getnext(); d) bool emptylist(); e) void addlistbegin (listnode *temp); f) void addlistend (listnode *temp); g) int listcount(); (1+1+2+2+1+1+1+13 marks) (b) Explain the concept underlying Stack and Queue. (2 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
