This algorithm takes the name because it resembles sorting pancakes with a big spatula, where the cook uses it to flip some of the pancakes on the top.
To achieve a correct sorting, the first step is to find the max element position (method findGreatestElement), then "flipping" the numbers until the max element position, and repeat.
Implementing PancakeSort in Java language.
This algorithm takes the name because it resembles sorting pancakes with a big spatula, where the cook uses it to flip some of the pancakes on the top.
To achieve a correct sorting, the first step is to find the max element position (method findGreatestElement), then "flipping" the numbers until the max element position, and repeat.
issue #1