This repository contains the implementation of the Pushswap algorithm using the Mechanical Turk approach. Pushswap is a sorting algorithm specifically designed for integer arrays. The Mechanical Turk variant leverages the concept of outsourcing computational tasks to humans, mimicking the historical practice where a human chess player would make moves dictated by a "Turk" automaton.
Pushswap is a sorting algorithm that operates on two stacks, named A
and B
. The algorithm sorts the A
stack in ascending order using a set of operations defined for stack manipulation. The Mechanical Turk version of Pushswap involves outsourcing the decision-making process of selecting optimal moves to human participants, who provide instructions based on the current state of the stacks.
To utilize Pushswap Mechanical Turk, follow these steps:
- Clone the repository to your local machine: git clone https://github.com/Prodaturu/Pushswap_MechanicalTurk.git
- Navigate to the cloned directory: cd Pushswap_MechanicalTurk
- Run the Pushswap algorithm that uses Mechanical Turk algo to sort the stack:
./pushswap_mechanical_turk <integer_array>
4.Replace
<integer_array>
with the array you want to sort.
Contributions to enhance the functionality, efficiency, or documentation of Pushswap Mechanical Turk are welcome. If you have ideas for improvements or bug fixes, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.
The Pushswap algorithm and its variants are inspired by the work of other 42 programmers in the field of computational algorithms and sorting techniques. Special thanks to Yigit Ogun whose medium article has inspired me to optimise the algorithm a little more.