In this repo I tried to investigate what kind of solution is better (performance-wise): iterative or recursive on a specific task. This repo is public, feel free to run it yourself, check results with other tests or algorithms.
- string input given that is contained with only for letters: A, B, C, D.
- algorithm should remove all occurances of following substrings: AB, BA, CD, DC
Main assumption is that recursive algorithm may perform better than iterative solution with runtime complexity O(n) on certain inputs. That assumption is backed with recursive algorithm memoization approach. If hash function for the input works with expected O(1) runtime complexity, recursive calls for input with known result will not be processed. To prove that I need to write iterative and recursive algos so that iterative perform better on all inputs.
- CMake
- C++ compiler with support of C++17 (duh!)
Project is supposed to be cross-platform, but it is tested on Windows onlz. Feel free to check it by yourself on other platforms.
mkdir build
cd build
cmake ..
It will generate project with default project generator on your platform. You can specify any project generator by passing -G parameter with generator name.
cmake -G "Ninja" ..
Check list of available generators by running cmake --help
Build it as usual project generated by CMake