I'm taking an intro to programming course and one of our assignments is to write a lossless compression program in C++. The only limitations we have are that we can not use the STL, static variables, or global variables. A lot of the compression algorithms I have found require use of map/multimap which I am not allowed to use so Huffman encoding and LZW are pretty much out of the question unless I can write my own map class and get it to work.
A lot of algorithms I found also use std::string, but I am perfectly fine using cstring (which we are allowed to use). I also have access to some libraries created by my professor that we can use. We have access to the following:
- Various trees such as Red-Black, AVL, Splay
- Binary Heap
- Various hash tables such as several open addressing implementations, as well as separate chaining
- Vector, Linked List, and Queue
So anything besides the above I would have to write the code for myself.
Does anyone have any very simple lossless compression algorithms they would recommend? Huffman and the other compression algorithms I found online seem very complex, not to mention I cannot use map/multimap in STL :(. I'm not looking for the absolute fastest algorithm here, just something to serve as a starting point and we will adjust it as needed to make it run faster.
std::maporstd::multimapwhat's stopping you from implementing a very basic version of your own that gets the job done? - AndyG