r/learnprogramming • u/Temporary-Warthog250 • Apr 05 '22
Name one programming/comp sci concept you never understood and if you understand it, try to explain it to them
Name a programming concept such as virtual functions, pointers, certain algorithms, etc that you always had a hard time understanding and why.
Someone else who reads yours and does understand it, try to explain it to them to help them learn
1.6k
Upvotes
4
u/KimPeek Apr 05 '22
Right, but "a function calls itself" is an oversimplified description, not a definition of recursion. It reduces recursion down the point of being useless and is probably why people struggle with applying it. It doesn't help anyone in this thread who doesn't know how to apply recursion to solve a problem.
The definition I gave is not mine. It's from Robert Sedgewick who is the author of one of the most widely used Data Structure and Algorithms books. Page 25 of Algorithms Fourth Edition, halfway down the page. I'm also not the only one to use this definition in this thread.