To complement my post on recursive joins to create hierarchical structures, here's the opposite code to flatten a hierarchy by performing a recursive select in LINQ and returning a flat IEnumerable<T>. Consider the following hierarchical data:NodeDat...
Filed under:
Algorithms
C#
LINQ
Here's a clean solution to doing recursive hierarchical joins in LINQ and C#. I couldn't find an example that didn't use an intermediate "node" class, so I'd like to introduce my approach which provides extension methods to IEnumerabe<T> for doing re...
Filed under:
Algorithms
C#
LINQ
The AVL tree is a rigorously balance binary search tree with very fast and stable insert, delete and search times. I like the various .NET dictionaries but have been unimpressed by their performance. So, after researching efficient dictionary algorit...
Filed under:
Algorithms
C#
Performance
In this post, I thought I'd look at a complete server-side and client-side solution for validating credit card numbers using the LUHN algorithm for both ASP.NET Web Forms and MVC. The core code uses some nice LINQ that I have previously blogged about...
Filed under:
Algorithms
ASP.NET
C#
JavaScript
LINQ
MVC
Security
The RC4 algorithm is a symmetric stream cipher and despite having known security vulnerabilities, RC4 is still widely used. I'm quite fond of RC4 due to the ease of implementation which made RC4 an ideal choice of symmetric encryption algorithm back...
Filed under:
Algorithms
C#
Cryptography
Security
The MD4 hash algorithm is a member of RSA's family of hashing recipes. However, due to certain security design flaws it is no longer used in modern cryptography. Surprisingly, it still plays a vital part in Microsoft Windows NTLM authentication and i...
Filed under:
Algorithms
C#
Cryptography
LINQ
Security