2 using System.Collections.Generic;
3 using System.Diagnostics;
11 public Node (int depth) : this (depth, null) {}
13 public Node (int depth, Node sibling) {
15 this.child = new Node (depth - 1);
17 this.sibling = sibling;
20 public override String ToString () {
21 return String.Format ("Node[child={0},sibling={1}]", this.child, this.sibling);
26 * Usage : width [depth [collections]]
27 * - width : trigger the overflow
28 * - depth : modify the cost difference of the overflow
29 * - collections : # of collections to perform
31 public static void Main (String[] args) {
34 width = Math.Max (width, Int32.Parse (args [0]));
38 depth = Math.Max (depth, Int32.Parse (args [1]));
40 int collections = 100;
42 collections = Math.Max (collections, Int32.Parse (args [2]));
46 for (int i = 0; i < width; i++) {
47 sibling = new Node(depth, sibling);
48 if (i > 0 && i % 10 == 0)
52 for (int i = 0; i < collections; i++) {
54 if (i > 0 && i % 10 == 0)