public static void PrintChain(IntNode chain) { for (; chain != null; chain = chain.GetNext()) { Console.Write("" + chain + "->"); } Console.WriteLine("#"); }
static void Insert(int x) { if (null == chain) { chain = new IntNode(x); return; } IntNode temp = new IntNode(x, chain.GetNext()); chain.SetNext(temp); }