-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArray1.h
52 lines (38 loc) · 956 Bytes
/
Array1.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
// this file defines the class Array.
#ifndef ARRAY1_H
#define ARRAY1_H
#include <stdlib.h>
#include <iostream>
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <malloc.h>
using namespace std;
class Array {
friend ostream &operator<< (ostream &, Array &);
public:
Array(int sz);
~Array();
void set_array(int *ary){ptr = ary;};
void set_size(int sz){ thesize = sz;};
void set_totsize(int sz){totSize = sz;};
void setitem(int pos, int val){ptr[pos] = val;};
void reset(){ thesize = 0;};
int *get_array(){ return ptr;};
unsigned int size() {return thesize;};
int totsize(){ return totSize;};
int item (int index) {return ptr[index];};
// int &support(){ return sup; }
void add(int);
int operator[] (unsigned int);
//void Quick_Sort();
//void qsort1(int, int);
bool Ismember(int);
bool Isubset(Array *, int);
private:
unsigned int totSize;
unsigned int thesize;
int *ptr;
// int sup;
};
#endif