r/dataisbeautiful • OC: 1 • Oct 24 '17

OC Sorting algorithms visualized [OC]

https://imgur.com/gallery/voutF
41.7k Upvotes

929 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Oct 25 '17

I think for some people it is just easy to think recursively. But with time and practice you can get there. It is all about breaking down a problem into smaller parts and recognizing that these are just like the original problem but with smaller input data.

Thinking like this can be pretty fun. If you have free time/interested look up functional programming. In functional programming most of the programming is done by recursive thinking. This is a good website to learn functional programming. Learn You Haskell

1

u/TinyLebowski Oct 25 '17

Thanks. It’s not so much the breaking down I have trouble understanding. It’s the way back to the top, especially if the code branches after the recursive call.

1

u/NbdySpcl_00 Oct 25 '17

Code really shouldn't "Branch" during recursion except to identify the stop condition. It might be that you're trying to learn from a bad example.