This repository contains the source code of an algorithm to sort N stacks with N values considering stacks limitations for removing nodes (can only pop first node), developed by:
Ramón Álvarez (ralvarezdev).
Only C++.
- Clone this repository to your local machine using the following command:
git clone https://github.com/ralvarezdev/uru-dsa
- Change your Current Working Directory to where the repository was cloned
- Move to 'sorting-stacks' directory
- There are two ways to compile the program:
- With G++ (you must have installed MinGW Compiler). Use the following command:
Command for Windows
g++ -o bin\SortingStacks.exe src\main.cpp src\lib\namespaces.h src\lib\algorithm\modHanoi.h src\lib\algorithm\modHanoi.cpp src\lib\terminal\ansiEsc.h src\lib\terminal\ansiEsc.cpp src\lib\terminal\input.cpp src\lib\terminal\input.h
Command for Linux
g++ -o bin/SortingStacks.exe src/main.cpp src/lib/namespaces.h src/lib/algorithm/modHanoi.h src/lib/algorithm/modHanoi.cpp src/lib/terminal/ansiEsc.h src/lib/terminal/ansiEsc.cpp src/lib/terminal/input.cpp src/lib/terminal/input.h
- With CMake (you must have installed CMake and Make). First, get to the
bin
folder. Use the following commandCommand for Windows
cmake -S ..\ -G "MinGW Makefiles" -B .\ && make
Command for Linux
cmake -S ../ -G "MinGW Makefiles" -B ./ && make
- Run the program by clicking
SortingStacks.exe
.
For a better user experience, resize the terminal window to Fullscreen Mode