-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.cpp
25 lines (24 loc) · 1.05 KB
/
list.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
***************************
* *
* Author: Swaraj Deep *
* *
***************************
*/
template <typename T>
class list
{
private:
void operator=(const list &) {} // Protect the assignment operator
list(const list &) {} // Protect the copy constructor
public:
list() {} // Default Constructor
~list() {} // Default Destructor
virtual void insert(const T &, int) = 0; // Insert a given element to the postion
virtual void append(const T &) = 0; // Append a given element to the last
virtual T peek_first() = 0; // Return the last element in the list
virtual bool remove_at(int) = 0; // Return true if the element is removed from the index
virtual bool remove(const T &) = 0; // Return true if the element is removed
virtual int length() = 0; // Return the number of elements present in the list
virtual bool find(const T &) = 0; // Return true if the element is found
};