Elm icon indicating copy to clipboard operation
Elm copied to clipboard

Add verbose mode to sorting algos

Open frankschmitt opened this issue 5 years ago • 0 comments

I'd like to propose adding some kind of verbose mode to the sorting algos - if enabled, it prints the list in every step (possibly with some kind of explanatory comment).

Example:

Quick.sort [3, 4, 2] verbose

Output:

sorting [3, 4, 2] -> lt: [2], eq: [], gt: [4], pivot: 3 sorting [2]: already sorted sorting []: already sorted sorting [4]: already sorted result: [2] ++ ([] ++ [3]) ++ [4] = [2, 3, 4]

Would this be useful? If yes, I can start working on a PR.

EDIT On second thoughts, a visual representation (like the Dart Repo provides) might be much more useful (but also harder to implement). I'd love to get feedback on this idea!

frankschmitt avatar Oct 22 '20 19:10 frankschmitt