Used in algorithms
Merge Sort
Binary Search
Typical for various operations related to Trees and other non-linear data structures
OS Folder structure traversal
HTML/DOM trees and other “Visual Trees” – WPF, WinForms
Used in algorithms
DFS – graphs, also trees
Math - Factorial, Fibonacci, Combinatorial problems
Develops analytical thinking
High chance to be asked on interviews!
\( n! = n * (n-1)! \) for n > 0
\( n! = 1 \) for n = 0
\( 5! = 5 * 4! = 5 * 4 * 3 * 2 * 1 * 1 = 120 \)
\( 4! = 4 * 3! = 4 * 3 * 2 * 1 *1 = 24 \)
\( 3! = 3 * 2! = 3 * 2 * 1 * 1 = 6 \)
\( 2! = 2 * 1! = 2 * 1 * 1 = 2 \)
\( 1! = 1 * 0! = 1 * 1 = 1 \)
\( 0! = 1 \)
static decimal Factorial(decimal num)
{
if (num == 0)
{
return 1;
}
var result = num * Factorial(num - 1);
return result;
}
Where is the bottom?
Where is the bottom?
Where is the bottom?
Where is the bottom?
Solving Computational Problems by Generating All Candidates