## Books on Algorithms

Also see my – Problem Books for Pure Math, Physics and Mathematical Physics If you are looking for a recap of C.S. concepts for a hard-core programming interview, look no further than these two books. The first one – Data...

## Recursion versus 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 Recursion The problem with recursion...

## 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 tree. class BinaryTree<T> { private BinaryTree<T>...

## LINQ–search for items in a list that are present in another list

Suppose you have a list of strings – a nursery rhyme may be a good example.  And you need to find ALL the words that match from another list of words. Using LINQ to search a list for items in another list (should return a...

## Using Delegates in C#

Introduction Delegates encapsulate a method. All they do is provide an alternate way to call (‘invoke’) a method. This concept has been around for a while (function pointers in C – and other languages). In C#, there are...

## The ‘params’ keyword in c#

Introduction I was confused by the appearance of ‘params’ in the signature of a method (see example snippet below). It seemed redundant – even if I removed it, the method worked just fine. void DisplayStrings(params...

## Async and Await, an easy way to keep your user interface responsive

Introduction Normally, when you invoke a method, it is invoked synchronously on your calling thread. Since you made no provision to ‘unblock’ the main thread, the method essentially ‘blocks’ the thread – which means...