Skip to content

Commit cb2d752

Browse files
committed
READMEs
1 parent 9e2b424 commit cb2d752

22 files changed

+195
-14
lines changed

Chap.00/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 0 Extra
2+
3+
- Minimum Spanning Tree: Kruskal
4+
- Minimum Spanning Tree: Prim
5+
- Minimum Spanning Tree: Sibeyn
6+
- Skip List
7+
- Treap
8+

Chap.03/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 3 Random Sampling
2+
3+
- Drawing from all un-sampled positions
4+
- Dictionary of sampled positions
5+
- Sorting sampling
6+
- Scanning an selecting
7+
- Heap and random keys
8+
- Reservoir sampling

Chap.03/dictionary_sampling.hpp

Whitespace-only changes.

Chap.03/drawing_sampling.hpp

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
License: GPL-3.0
3+
Author: Gaspare Ferraro <[email protected]>
4+
*/
5+
6+
#pragma once
7+
8+
#include <vector>
9+
#include <utility>
10+
#include <iterator>
11+
12+
template <class T>
13+
std::vector<T> drawing_sampling(const std::vector<T> S, int m) {
14+
15+
}

Chap.03/heap_sampling.hpp

Whitespace-only changes.

Chap.03/reservoir_sampling.hpp

Whitespace-only changes.

Chap.03/scanning_sampling.hpp

Whitespace-only changes.

Chap.03/sorting_sampling.hpp

Whitespace-only changes.

Chap.04/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 4 List Ranking
2+
3+
- Pointer jumping technique
4+
- Divide&Conquer approach

Chap.05/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 5 Sorting Atomic Items
2+
3+
- Binary Merge sort
4+
- Snow Plow
5+
- Three-way Quick sort
6+
- Rand select
7+
- Bounded space Quick sort
8+
- Dual Pivot Quick sort

Chap.06/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 6 Set Intersection
2+
3+
4+
- Merge-based Set intersection ([merge_intersection.hpp](merge_intersection.hpp))
5+
- Binary-search-based Set intersection ([binary_search.hpp](binary_search_intersection.hpp))
6+
- Mutual Partitioning Set intersection ([mutual_partitioning.hpp](mutual_partitioning.hpp))
7+
- Doubling Search Set intersection ([doubling_search.hpp](doubling_search.hpp))
8+

Chap.06/benchmark.cpp

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
License: GPL-3.0
3+
Author: Gaspare Ferraro <[email protected]>
4+
*/
5+
6+
#include <bits/stdc++.h>
7+
#include "binary_search_intersection.hpp"
8+
#include "merge_intersection.hpp"
9+
#include "doubling_search.hpp"
10+
#include "mutual_partitioning.hpp"
11+
12+
using namespace std;
13+
14+
vector<int> randomSet(int size, int max, int min=1) {
15+
16+
if( max < min ) return randomSet(size, min, max);
17+
assert( max-min+1 > size );
18+
19+
random_device rd;
20+
mt19937 rng(rd());
21+
uniform_int_distribution<int> uni(min, max);
22+
23+
set
24+
25+
}
26+
27+
int main()
28+
{
29+
30+
31+
set<int> sa, sb;
32+
while( sa.size() < 50 ) sa.insert( uni(rng) );
33+
while( sb.size() < 20 ) sb.insert( uni(rng) );
34+
35+
vector<int> a(sa.begin(), sa.end());
36+
vector<int> b(sb.begin(), sb.end());
37+
vector<int> c(20);
38+
39+
auto it = set_intersection(a.begin(), a.end(), b.begin(), b.end(), c.begin());
40+
c.resize(it-c.begin());
41+
42+
auto d = binary_search_intersection<int>(a, b);
43+
auto e = merge_intersection<int>(a, b);
44+
auto f = doubling_search_intersection<int>(a, b);
45+
auto g = mutual_partitioning_intersection<int>(a, b);
46+
47+
printf("stl set_intersection:\n\t");
48+
for(auto x : c)
49+
printf("%d ", x);
50+
printf("\n");
51+
52+
printf("binary_search_intersection:\n\t");
53+
for(auto x : d)
54+
printf("%d ", x);
55+
printf("\n");
56+
57+
printf("merge_intersection:\n\t");
58+
for(auto x : e)
59+
printf("%d ", x);
60+
printf("\n");
61+
62+
printf("doubling_search_intersection:\n\t");
63+
for(auto x : f)
64+
printf("%d ", x);
65+
printf("\n");
66+
67+
printf("mutual_partitioning:\n\t");
68+
for(auto x : g)
69+
printf("%d ", x);
70+
printf("\n");
71+
72+
return 0;
73+
}
74+

Chap.07/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 7 Sorting Strings
2+
3+
- MSD Radix sort
4+
- LSD Radix sort
5+
- Multikey Quick sort

Chap.08/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# 8 The Dictionary Problem
2+
3+
- Order Preserving Minimal Perfect Hash Function
4+
- Two-Level hashing
5+
- Cuckoo hashing
6+
- Bloom Filters

Chap.09/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 9 Searching Strings by Prefix
2+
3+
- Compacted Trie
4+
- Patricia Trie

Chap.10/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 10 Serching Strings by Substring
2+
3+
- Suffix Array
4+
- LCP Array
5+
- Suffix Tree
6+
- Approximate-pattern matching
7+
- LCA via RMQ

Chap.11/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# 11 Integer Coding
2+
3+
- Binary code ([binary_code.hpp](binary_code.hpp))
4+
- Unary code ([unary_code.hpp](unary_code.hpp))
5+
- Fixed-Length code ([fixed_length_code.hpp](fixed_length_code.hpp))
6+
- Elias Gamma code ([elias_gamma_code.hpp](elias_gamma_code.hpp))
7+
- Elias Delta code ([elias_delta_code.hpp](elias_delta_code.hpp))
8+
- Rice code ([rice_code.hpp](rice_code.hpp))
9+
- PForDelta code ([pfordelta_code.hpp](pfordelta_code.hpp))
10+
- Variable-byte code ([variable_byte_code.hpp](variable_byte_code.hpp))
11+
- (s,c)-dense code ([sc_dense_code.hpp](sc_dense_code.hpp))
12+
- Interpolative code ([interpolative_code.hpp](interpolative_code.hpp))
13+
- Elias-Fano code ([elias_fano_code.hpp](elias_fano_code.hpp))
14+

Chap.11/variable_byte_code.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77

88
#include <vector>
99
#include "binary_code.hpp"
10+
11+

Chap.12/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# 12 Statistical Coding
2+
3+
- Huffman coding
4+
- Canonical Huffman
5+
- Arithmetic Coding
6+

Chap.13/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# 13 Dictionary-based Compressors
2+
3+
- LZ77
4+
- LZSS
5+
- LZ78
6+
- LZW

Chap.14/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# 4 The Burrows-Wheeler Transform
2+
3+
- Burrows-Wheeler Transform
4+
- Move-To-Front Transform
5+
- Run-Length-Encoding Transform
6+
- BZip compressor

README.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ implementation of some algorithms seen during the Algorithm Engineer course @ Un
66

77
Chapters:
88

9-
3 Random Sampling
9+
[3 Random Sampling](Chap.03/)
1010
------------------
1111

1212
- Drawing from all un-sampled positions
@@ -16,13 +16,13 @@ Chapters:
1616
- Heap and random keys
1717
- Reservoir sampling
1818

19-
4 List Ranking
19+
[4 List Ranking](Chap.04/)
2020
------------------
2121

2222
- Pointer jumping technique
2323
- Divide&Conquer approach
2424

25-
5 Sorting Atomic Items
25+
[5 Sorting Atomic Items](Chap.05/)
2626
------------------
2727

2828
- Binary Merge sort
@@ -32,36 +32,36 @@ Chapters:
3232
- Bounded space Quick sort
3333
- Dual Pivot Quick sort
3434

35-
6 Set Intersection
35+
[6 Set Intersection](Chap.06/)
3636
------------------
3737

3838
- Merge-based Set intersection ([merge_intersection.hpp](Chap.06/merge_intersection.hpp))
3939
- Binary-search-based Set intersection ([binary_search.hpp](Chap.06/binary_search_intersection.hpp))
4040
- Mutual Partitioning Set intersection ([mutual_partitioning.hpp](Chap.06/mutual_partitioning.hpp))
4141
- Doubling Search Set intersection ([doubling_search.hpp](Chap.06/doubling_search.hpp))
4242

43-
7 Sorting Strings
43+
[7 Sorting Strings](Chap.07/)
4444
------------------
4545

4646
- MSD Radix sort
4747
- LSD Radix sort
4848
- Multikey Quick sort
4949

50-
8 The Dictionary Problem
50+
[8 The Dictionary Problem](Chap.08/)
5151
------------------
5252

5353
- Order Preserving Minimal Perfect Hash Function
5454
- Two-Level hashing
5555
- Cuckoo hashing
5656
- Bloom Filters
5757

58-
9 Searching Strings by Prefix
58+
[9 Searching Strings by Prefix](Chap.09/)
5959
------------------
6060

6161
- Compacted Trie
6262
- Patricia Trie
6363

64-
10 Searching Strings by Substring
64+
[10 Searching Strings by Substring](Chap.10/)
6565
------------------
6666

6767
- Suffix Array
@@ -70,7 +70,7 @@ Chapters:
7070
- Approximate-pattern matching
7171
- LCA via RMQ
7272

73-
11 Integer Coding
73+
[11 Integer Coding](Chap.11/)
7474
------------------
7575

7676
- Binary code ([binary_code.hpp](Chap.11/binary_code.hpp))
@@ -83,32 +83,32 @@ Chapters:
8383
- Variable-byte code ([variable_byte_code.hpp](Chap.11/variable_byte_code.hpp))
8484
- (s,c)-dense code ([sc_dense_code.hpp](Chap.11/sc_dense_code.hpp))
8585
- Interpolative code ([interpolative_code.hpp](Chap.11/interpolative_code.hpp))
86-
- Elias-Fano code ([elias_fano.hpp](Chap.11/elias_fano.hpp))
86+
- Elias-Fano code ([elias_fano_code.hpp](Chap.11/elias_fano_code.hpp))
8787

88-
12 Statistical Coding
88+
[12 Statistical Coding](Chap.12/)
8989
------------------
9090

9191
- Huffman coding
9292
- Canonical Huffman
9393
- Arithmetic Coding
9494

95-
13 Dictionary-based compressors
95+
[13 Dictionary-based compressors](Chap.13/)
9696
------------------
9797

9898
- LZ77
9999
- LZSS
100100
- LZ78
101101
- LZW
102102

103-
14 The Burrows-Wheeler Transform
103+
[14 The Burrows-Wheeler Transform](Chap.14/)
104104
------------------
105105

106106
- Burrows-Wheeler Transform
107107
- Move-To-Front Transform
108108
- Run-Length-Encoding Transform
109109
- BZip compressor
110110

111-
0 Extra
111+
[0 Extra](Chap.00/)
112112
------------------
113113

114114
- Minimum Spanning Tree: Kruskal

0 commit comments

Comments
 (0)