Tag Archives: C#

Recursive Permutations Generator

This is a Permutations class which will calculate all permutations of a given array, by recursively calling a method within. Usage is rather simple that you need to just do a Permuter = new Permutation(AlphaSet) and then take the Permuter.Resultset array for all permutations.

As per feedback, the Permutation class has been modified to take in variable length string arrays also, instead of just single-character string arrays as in the example here. The method adopted (of running a proxy permutation first and mapping to real array) may not be the most efficient one. But it works! ;)

Class

Usage

Recursive File List Builder

This class builds a file list out of a directory tree, starting from a specified folder. Search pattern (like *.asp, *.exe) and the level (or depth 0=all, 1=current, n=n levels) of recursion to number of sub-directories can be specified. Usage of the class is given towards the end of the article.

and the usage would be like this…

Generate Table Schema

This is a simple (but often useful) tool to generate the xml schema of a database table. The tool supports only SQL Server over Windows Authentication. The source code here can be easily extended for other uses.