-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalistint.h
57 lines (34 loc) · 1.29 KB
/
alistint.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef ALISTINT_H
#define ALISTINT_H
class AListInt
{
public:
int* list;
//****************************** constructors*********************************
AListInt();
AListInt(int cap);
//*************************** Destructor**************************************
~AListInt();
//****************** Returns the current number of items in the list *********
int size() const;
// *****************Returns true if the list is empty, false otherwise********
bool empty() const;
//********************** Inserts val so it appears at index, pos**************
void insert (int pos, const int& val);
//***********************Removes the value at index, pos*******************
void remove (int pos);
/****************Overwrites the old value at index, pos, with val********** */
void set (int position, const int& val);
/************************ Returns the value at index, pos***********************/
int& get (int position) ;
/*************************** Returns the value at index, pos**************/
int const & get (int position) const;
int is_filled();
private:
/***************Should double the size of the list maintaining its contents****/
void resize();
/* Add necessary data members here */
int size_;
int filled;
};
#endif