static void Main(string[] args) { //Node<Point> points = ChainGenerator.CreateChain(); //Print(points); //Node<int> head = ChainGenerator.SortedChain(); //Print(head); //Console.WriteLine("the chains is {0} sorted", IsSorted(head) ? " " : " not "); //head = ChainGenerator.GetChain(6); //Print(head); //Console.WriteLine("the chains is {0} sorted", IsSorted(head) ? " " : " not "); //int[] ar1 = { 2, 4, 5, 3, 1, 2, 4 }; //int[] ar2 = { 1, 2, 4 }; //int[] ar3 = { 5, 3, 6 }; //int [] ar4 ={ 4, 6,2}; //Node<int> head1 = ChainGenerator.GetChain(ar1); //Node<int> head2 = ChainGenerator.GetChain(ar2); //if (Contains(head1, head2)) // Console.WriteLine("Success"); //else // Console.WriteLine("BACK TO THE DRAWING BOARD"); //head2 = ChainGenerator.GetChain(ar3); // if (Contains(head1, head2)) // Console.WriteLine("BACK TO THE DRAWING BOARD"); // else // Console.WriteLine("Success"); //head2 = ChainGenerator.GetChain(ar4); // if (Contains(head1, head2)) // Console.WriteLine("BACK TO THE DRAWING BOARD"); // else // Console.WriteLine("Success"); //Node<Range> ranger = ChainGenerator.GenerateRangeList(); //ChainGenerator.Print(ranger); //ranger = Join(ranger); //ChainGenerator.Print(ranger); Node <int> head = ChainGenerator.GetChain(10); Print(head); head = Mission2(head, 5); Print(head); //int[] ar = { 12, 323, 182, 44, 120, 67, 34, 125, 3, 92 }; //Console.WriteLine(Something(ar, 0, 9)); Console.ReadKey(); }
public static Node <int> SortedChain() { return(ChainGenerator.GetChain(new int[] { 1, 4, 5, 11, 22 })); }