Using C++ Using your own creativity, make a set of class templates that have these features: For this class template, put everything in one place--do not declare the member functions and have separate definition of the member functions elsewhere. Keep them in one place. A class template with 2 template parameters, T1 and T2. Include a private variable. Include a constructor that loads the private variable when constructed. Include a destructor that clears the private variable to zero. Include set and get functions to set and get the private variable. For this class template, use declarations for variables and functions, like you do in header file (which you may use if you want). Then, separately put the full function definitions for each class member function on their own, like you do in a separate implementation file (which you may use if you want). Include at least 2 private variables. Include a constructor that loads the private variables when constructed. Include a destructor that clears the private variables to zero. Include the usual set and get functions to access the private variables. Include other functions as you wish. Within main (): Call your template functions and demonstrate how they work. Construct objects and show off your amazing programming skills!
Types of Linked List
A sequence of data elements connected through links is called a linked list (LL). The elements of a linked list are nodes containing data and a reference to the next node in the list. In a linked list, the elements are stored in a non-contiguous manner and the linear order in maintained by means of a pointer associated with each node in the list which is used to point to the subsequent node in the list.
Linked List
When a set of items is organized sequentially, it is termed as list. Linked list is a list whose order is given by links from one item to the next. It contains a link to the structure containing the next item so we can say that it is a completely different way to represent a list. In linked list, each structure of the list is known as node and it consists of two fields (one for containing the item and other one is for containing the next item address).
Using C++
- Using your own creativity, make a set of class templates that have these features:
- For this class template, put everything in one place--do not declare the member functions and have separate definition of the member functions elsewhere. Keep them in one place.
- A class template with 2 template parameters, T1 and T2.
- Include a private variable.
- Include a constructor that loads the private variable when constructed.
- Include a destructor that clears the private variable to zero.
- Include set and get functions to set and get the private variable.
- For this class template, use declarations for variables and functions, like you do in header file (which you may use if you want).
- Then, separately put the full function definitions for each class member function on their own, like you do in a separate implementation file (which you may use if you want).
- Include at least 2 private variables.
- Include a constructor that loads the private variables when constructed.
- Include a destructor that clears the private variables to zero.
- Include the usual set and get functions to access the private variables.
- Include other functions as you wish.
- Within main ():
- Call your template functions and demonstrate how they work.
- Construct objects and show off your amazing programming skills!
Step by step
Solved in 2 steps with 1 images