Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
3 posts found #recursion
Deriving Time Complexity from Code: Loops, log n and Recursion
Computer Science Fundamentals PART 02

Deriving Time Complexity from Code: Loops, log n and Recursion

To read complexity from code, add sequential blocks, multiply nested loops, call a loop that halves every step log n, and write a recurrence for recursion. With real counts: triangular loops, naive Fibonacci, merge sort, the master theorem, LINQ's hidden loops and an order-matching benchmark going from O(n·m) to O(n+m).

8 Nov 2026 13 min 1
Backtracking: Pruning the Search Tree with Permutations, Subsets and Sudoku
Computer Science Fundamentals PART 19

Backtracking: Pruning the Search Tree with Permutations, Subsets and Sudoku

Backtracking tries every option systematically with choose, explore and unchoose steps; its real power is pruning branches that cannot reach a solution early: 2,057 nodes instead of 19 million for 8-Queens. In C# we write permutation, subset and combination generators with yield return, N-Queens, a Sudoku solver that starts from the most constrained cell, and a rule-based product configurator.

8 Nov 2026 13 min 2
Recursion in C#: Base Case, Call Stack, StackOverflowException and Converting to Iteration
Computer Science Fundamentals PART 05

Recursion in C#: Base Case, Call Stack, StackOverflowException and Converting to Iteration

In .NET a StackOverflowException cannot be caught and kills the whole process; on an 8 MB main thread an empty method called itself about 130,650 times and the catch block never ran. We cover the anatomy of recursion, call stack frames, converting recursive code to iteration with an explicit Stack<T>, and depth defences such as JSON MaxDepth (64) and EnsureSufficientExecutionStack, with xUnit tests and real output.

8 Nov 2026 10 min 2
Blog Map