quicksort in GP

Post your nifty GP projects here!

Moderator: MSandro

Post Reply
manyone
Posts: 41
Joined: Nov 5th, '17, 07:56

quicksort in GP

Post by manyone » Mar 17th, '21, 07:20

i've been trying to learn haskell (up to, but not including the m-word!) but i've learned enough to appreciate that haskell can truly represent the quicksort algorithm in a very simple and elegant way.

I tried to translate it to GP using its built-in filter block but i couldn't get it to work, so i wrote my own filter instead.

enjoy!
Attachments
quicksort.jpg
haskell's elegant solution for quicksort
quicksort.jpg (10.86 KiB) Viewed 35515 times
qsortgpp.jpg
quicksort blocks
qsort_try.gpp
GP program to do quicksort
(6.36 KiB) Downloaded 1906 times

Post Reply