public static void Main()
Console.WriteLine("Hello World");
int[][] sons = new int[5][];
sons[0] = new int[] { 1, 2 };
sons[2] = new int[] { 3 };
sons[3] = new int[] { 4 };
Console.WriteLine("Depth={0}", Depth(sons, 0));
public static int Depth(int [][] sons, int node)
foreach(int child in sons[node])
depth = Math.Max(depth, 1 + Depth(sons, child));