Rekurzia
Rekurzia is a fundamental concept in computer science and mathematics where a function calls itself. This self-referential definition allows complex problems to be broken down into smaller, simpler instances of the same problem. A recursive function typically consists of two parts: a base case and a recursive step. The base case is the condition under which the function stops calling itself and returns a direct result. Without a base case, a recursive function would continue to call itself indefinitely, leading to infinite recursion and a program crash. The recursive step is where the function calls itself with a modified input, moving closer to the base case.
Common examples of problems solved using recursion include calculating factorials, traversing tree structures, and sorting algorithms