Stack algoritm example code Back tracking example. A stack is used to determine whether a flight exists from the origin city to the destination city. Compiled using clang++ compiler with std=C++11 flag.