Overview In general, whatever problem you can solve with Recursion can also be solved with Looping (iteration). It turns out, that for most use cases, Iteration (looping) performs better than Recursion The problem with recursion...

# Category - Algorithms, Data Structures, Collections

Algorithms, Data Structures, Collections in C#

Given a LEFT and a RIGHT property that returns the underlying LEFT tree and the underlying RIGHT tree respectively, find the total count of the nodes in the tree. class BinaryTree<T> { private BinaryTree<T>...

Everyone is familiar with the basic swap – using a temporary variable static void RegularSwapUsingTempVariable(ref int a, ref int b) { int temp = a; a = b; b = temp; } The same swap can be...

Considering the amount of time they have saved mankind, Hash-functions are among the most under-appreciated gems of computing. A hashing function will typically, using just a SINGLE lookup – retrieve a deeply buried...

Considering the amount of time they have saved mankind, Hash-functions are among the most under-appreciated gems of computing. A hashing function will typically, using just a SINGLE lookup – retrieve a deeply buried...