Posted on June 18, 2011, 9:33 pm, by Chaker Nakhli, under

.NET.

A few days ago, I needed to encode numeric identifiers in a short and url-safe format. Something similar to what url shorteners use (e.g. jcsSXP in http://bit.ly/jcsSXP). Encoding the ids in base 64 would work if an alternative alphabet is provided for the non url-safe symbols. But since I wanted to have only alpha-numeric characters, I chose […]

Posted on January 8, 2011, 2:29 pm, by Chaker Nakhli, under

.NET.

In this post I share another code Kata : an implementation of a binary heap. Once we have the heap implemented, we will easily deduce a heap sort and a priority queue based on it. It takes about 100 lines of C# code.

Posted on January 1, 2011, 4:46 pm, by Chaker Nakhli, under

.NET.

I find merge sort elegant and easy to implement and to understand for both iterative and recursive approaches. In this post I’ll share a quick (and probably dirty) iterative and recursive implementations of merge sort. Both versions share exactly the same merge operation. The implementation takes less than 30 lines of C#.