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

(a) The class interfaces of a linked list node and a linkedlist are provided below. Class Interface of Linked List Node class listnode

(a) The class interfaces 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); }; Kindly refer to the above Class Interfaces and answer the following questions: i. What is a constructor? Page 7 of 8 SITEIJune 2015/2016 Sem 2 Programming for Engineers (PROG1114C) i. Identify two constructors from above. ii. Differentiate between public and private class members. iv. Explain the concept of function overloading. V. Identify a function overloading from above. vi. Identify a destructor. vii. 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+1+1+1+14 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 What is a constructor Ans A constructor is a member function of a class which initializes objects of a class Constructor is a special member functio... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!