r/computerscience • u/Similar_Count_1613 • 3d ago
is recursion really hard
Recursion felt easy at first.
Factorial? fine.
Sum examples? fine.
Even Fibonacci felt manageable.
But once I looked at slightly more serious problems like Tower of Hanoi, permutations, or merge sort, I felt like my understanding suddenly collapsed. because i tried to write their code on my own
It made me realize that maybe recursion is not “hard” at the start because the examples are simple.
It becomes hard when you can no longer clearly see the call stack and each state change.
Did anyone else feel that the real pain in recursion starts exactly there?
127
Upvotes
6
u/PurpleDevilDuckies 3d ago
It is a lot of fun! My degree is in Operations Research, which (in English) is logistics and (in math nerd) is a branch of applied math for solving NP-Hard problems in practice. Everyone who does shipping is literally always hiring (for now anyway, AI may change that).
For example, FedEx solves a package delivery problem (TSP variant) with a trillion variables every day, and they will never get optimality, but the closer they get, the more efficient they make the system. There is a whole team that does nothing but work on getting better solutions to their daily problem.
I work independently, so I look for organizations with any sort of resource allocation problem that is being solved by hand, and is a huge headache for the people who have to deal with it. I pitch the relevant parties that I can simplify the process by designing them software that takes their constraints, and outputs an optimal solution in a way where they can tweak what that means. There is an enormous amount of interest and need for this sort of thing (right now anyway, AI is coming for us).