Archives for Algorithms, Data Structures, Collections
Books on Algorithms
Also see my – Problem Books for Pure Math, Physics and Mathematical Physics If you are looking for a recap of computer science algorithmic concepts either for fun or for…
Recursion versus Iteration ( Looping )
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…
Binary tree (count nodes) interview question
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 BinaryTree<T>{ private…
Swapping without a temp variable
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 =…
The Under-Appreciated Hash Function–Illustrated using a Birthday Lookup
Overview Arrays are superfast. Simply becasue the exact location (index) of the element is provided. What if we could tie that index to the actual value of the data being…
The Under-Appreciated Hash Function–Illustrated using a Birthday Lookup
Considering the amount of time they have saved mankind, Hash-functions are among the most under-appreciated gems of #160; A hashing function will typically, using just a SINGLE lookup – retrieve…