forked from BitSails/adts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathList.h
More file actions
30 lines (23 loc) · 696 Bytes
/
List.h
File metadata and controls
30 lines (23 loc) · 696 Bytes
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
26
27
28
29
30
#include <iostream>
#include <stdexcept>//used to be able to "throw" exceptions
using namespace std;
#ifndef LIST_H
#define LIST_H
class List //begin List definition
{
private:
class Node;//forward declaration (defined in the implementation file)
Node* frontPtr = nullptr;
int num_elements = 0;
public:
~List();//destructor
void insert(int element, int k);//insert element at location k
void remove(int k);//remove element at location k
int size();//return the number of elements in the List
/** MISSING OPERATIONS */
//... fill in ....
int clear();
int display();
int getAt(int k);
};//end List definition
#endif