Usage:
mkdir build
cd build
cmake ..
make -j8
Then go to the bin directory to find those executable files
This is a personal note of reading Algorithm 4th.
All the code(specified by "Algorithm x.y) in this book are going to be implemented by c++.
Some testfiles are from the official website, like largeUF.txt, 32Kints.txt.
Chapter1 I try to avoid using STL cause they are basic data structure.
Chapter2 - Chapter5
For convenient change the size of array and random access, I use the vector STL to be the sorted array.
Since our handmade data structure doesn't support generic template and range-for statement. In the later implementation I use (and only use) STL.
For example, although we implement a basic structure 2.6 MinPQ, the std::priority_queue in is more convenient to use.
Environment: linux-ubuntu
Compiler: g++ 9
Heap:
- Undirected Weighted Graph
- Lazy version of Prim's MST algorithm
- 4.7 Prim's MST Algorithm(eager version)
- 4.8 Kruskal's MST Algorithm
- directed Weighted Graph
- 4.9 Dijkstra's Shortest-Paths Algorithm
- 4.10 Shortest Paths in Edge-Weighted DAGS
- 4.11 Bellman-Ford Algorithm(queue-based)
- 5.10 Huffman-Encoding Compression
- 5.11 LZW Compression