-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathList.h
39 lines (32 loc) · 761 Bytes
/
List.h
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
31
32
33
34
35
36
37
38
39
#ifndef LIST_H
#define LIST_H
#include <iostream>
using namespace std;
#ifndef NULL
#define NULL 0
#endif
template <class Arbitrary>
struct LNode;
template <class Arbitrary>
class List {
LNode<Arbitrary> * end;
long occupancy;
public:
List (void) : end (NULL), occupancy (0) {}
~List (void);
Arbitrary * Insert (Arbitrary *, long);
Arbitrary * Remove (long);
Arbitrary * View (long) const;
long IsEmpty (void) const {
return ! NumElements ();
}
long NumElements (void) const {
return occupancy;
}
ostream & Write (ostream &) const;
};
/* where to insert, view, remove */
#define FRONT 0
#define END 1
#include "List.c"
#endif