CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Recursion
C#
class PowerSet
{
    static void Main(string[] args)
    {
        var set = Enumerable.Range(0, 8);
        foreach (var subSet in PowerSets(set))
            Console.WriteLine(String.Join(" ", subSet));
    }
 
    private static IEnumerable<IEnumerable<T>> PowerSets<T>(IEnumerable<T> masterSet)
by ccmouse   April 01, 2011 @ 8:11pm
144 Views
no comments
 
C#
    public class Tail
    {
        public static Action<T> RecursiveAction<T>(Action<T> a)
        {
            var methodInfo = Recursive(a.Method);
 
            Action<T> action = p =>
            {
                var t = methodInfo.DeclaringType;
                t.InvokeMember(methodInfo.Name, BindingFlags.InvokeMethod, null, t, new object[] { p });
by Athens Springer   December 17, 2009 @ 10:40pm
Tags: Recursion
307 Views
no comments
 
C#
private void GetHierarchyRecursive(int empId, List<Employee> emps) {
    List<Employee> subEmps = GetEmployeesManagedBy(empId);
    foreach (Employee c in subEmps) {
        emps.Add(c);
        GetHierarchyRecursive(c.EmployeeID, c.ManagedEmployees);
    }
}
by rtur   August 28, 2009 @ 12:47pm
Tags: c#, recursion
219 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate