예제 #1
0
 private static void AddLast(NodeIterator i, Node n)
 {
     if (i.Next == null)
     {
         i.Next = n;
     }
     else
     {
         AddLast(++i, n);
     }
 }
예제 #2
0
 private static void AddFirst(NodeIterator i, Node n)
 {
     if (i.Previous == null)
     {
         i.Previous = n;
     }
     else
     {
         AddFirst(--i, n);
     }
 }
예제 #3
0
        static void Main(string[] args)
        {
            //var meme = Node.NodeList( 5 );

            NodeIterator m = new NodeIterator(new Node(2));

            m.AddFirst(new Node(1));
            m.AddLast(new Node(3));
            m.AddLast(new Node(4));

            //Node.PrintList( meme.First );

            //int[] x = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
            //bubbleSort( x );
        }