Skip lists are a fascinating data structure: very simple, and yet have the same asymptotic efficiency as much more complicated AVL trees and red-black trees. While many standard libraries for various programming languages provide a sorted set data structure, there are numerous problems that require more control over the internal data structure than a sorted […]
There is a lot of information on the concurrent primitives and concepts exposed by the .NET Framework 3.5 available on MSDN, blogs, and other websites. The goal of this post is to distill the information into an easy-to-digest high-level summary: what are the different pieces, where they differ and how they relate. If you want […]
Continue reading about Overview of concurrency in .NET Framework 3.5
I realized that there is a very clean way to express a multi-clause if statement by composing ternary conditional operators like this: var result = condition1 ? result1 : condition2 ? result2 : condition3 ? result4 … : conditionN ? resultN : default;
Continue reading about A neat way to express multi-clause if statements in C-based languages
In responses to my last week’s post, several readers mentioned LINQ-like operators they implemented themselves. I also had ideas for operators that would lead to neat solutions for some problems, so I decided to give it some thought and collect up the most useful operators into a reusable library. My goal was to include operators […]
Continue reading about Extended LINQ: additional operators for LINQ to objects
Ever since I learned about LINQ, I keep discovering new ways to use it to improve my code. Every trick makes my code a little bit faster to write, and a little bit easier to read. This posting summarizes some of the tricks that I came across. I will show you how to use LINQ […]
Continue reading about 7 tricks to simplify your programs with LINQ
The folks at Dev 102 posted a programming job interview challenge. It is rather easy, but I figured that it may be a nice change of pace, since my last posting was fairly involved. The challenge is to reverse the bits in each byte, given a large array of bytes. What is the fastest possible […]
What is the time complexity of quicksort? The answer that first pops up in my head is O(N logN). That answer is only partly right: the worst case is in fact O(N2). However, since very few inputs take anywhere that long, a reasonable quicksort implementation will almost never encounter the quadratic case in real life. […]
Recent Comments