-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMemoryRun.h
More file actions
70 lines (41 loc) · 943 Bytes
/
MemoryRun.h
File metadata and controls
70 lines (41 loc) · 943 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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Run.h
*
*/
#ifndef MEMORYRUNn_H_
#define MEMORYRUNn_H_
#include "Entry.h"
#include "RunMetadata.h"
#include "ResultSet.h"
class MemoryRun {
private:
Entry *entries;
int maxEntries;
int nextPos;
public:
// implemented
MemoryRun(int size);
MemoryRun(Entry *entries, int size);
int numElements();
bool insert(Entry e);
bool insert(Entry *entry);
void insertAtPos(Entry e, int pos);
Entry *get(int key);
Entry *getBinarySearch(int key);
Entry at(int pos);
MemoryRun *getRange(int low, int high);
bool remove(int key);
Entry *getEntries();
static MemoryRun *merge(MemoryRun *older, MemoryRun *newer);
bool isEmpty();
void sort();
void print();
void reset();
void removeDeletes();
void removeDuplicates();
int getSize();
void setSize(int size);
void printer();
~MemoryRun();
};
#endif /* MEMORYRUN_H_ */