Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (56 loc) · 1.38 KB
/
Copy pathmain.cpp
File metadata and controls
64 lines (56 loc) · 1.38 KB
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
#include "LRU_Cache.h"
#include "LRU_K_Cache.h"
#include "LFU_Cache.h"
#include "LFU_Hash_Cache.h"
#include "ARC_Cache.h"
int main()
{
// ArcLruPart<int,std::string> ArcLru(3,3,2);
// ArcLru.put(1,"gch");
// ArcLru.put(2,"th");
// ArcLru.put(3,"wyh");
// ArcLru.put(4,"xhj");
// ArcLru.print();
// std::cout<<std::endl;
// ArcLru.put(5,"lyw");
// ArcLru.put(6,"ztn");
// ArcLru.print();
// std::cout<<std::endl;
// ArcLru.put(7,"wsh");
// ArcLru.print();
// std::cout<<std::endl;
// ArcLfuPart<int ,std::string> ArcLfu(3,3,2);
// ArcLfu.put(1,"gch");
// ArcLfu.put(2,"th");
// ArcLfu.put(3,"xhj");
// ArcLfu.print();
// ArcLfu.put(4,"wyh");
// ArcLfu.print();
// std::cout << std::endl;
// ArcLfu.put(5,"lyw");
// ArcLfu.put(6,"xy");
// ArcLfu.print();
// std::cout << std::endl;
// ArcLfu.put(4,"wyh");
// ArcLfu.put(5,"lyw");
// ArcLfu.print();
// std::cout << std::endl;
// ArcLfu.put(7,"ztn");
// ArcLfu.print();
ArcCache<int ,std::string> Arc(3,3,2);
Arc.put(1,"gch");
Arc.put(2,"th");
Arc.put(3,"xhj");
Arc.print();
Arc.put(4,"wyh");
Arc.put(5,"lyw");
Arc.put(6,"xy");
Arc.print();
Arc.put(1,"gch");
Arc.print();
Arc.put(1,"gch");
Arc.print();
std::cout << Arc.get(1) << std::endl;
Arc.print();
return 0;
}