コード例 #1
0
        static void TestScratchSearchBstRecursion(int[] values, int k)
        {
            Scr.Scratch s    = new Scr.Scratch();
            var         root = CreatTreeNodesNonGeneric(values);

            var result = s.SearchBstRecursion(root, k);
        }
コード例 #2
0
        static void TestScratchSearchBst(int[] values, int k)
        {
            Scr.Scratch s    = new Scr.Scratch();
            var         root = CreatTreeNodesNonGeneric(values);// new int[] { 4, 2, 7, 1, 3 });

            var result = s.SearchBst(root, k);
        }
コード例 #3
0
        static void TestScratchSwapPairs()
        {
            Scr.Scratch s    = new Scr.Scratch();
            var         head = CreateListNode();

            s.SwapPairs(head);
        }
コード例 #4
0
 static void TestSwap()
 {
     Scr.Scratch s    = new Scr.Scratch();
     var         head = CreateListNode();
     // var result = s.Swap(head);
     var result = s.SwapRecursion(head);
 }
コード例 #5
0
 static void TestLinkedLists()
 {
     Scr.Scratch s    = new Scr.Scratch();
     var         head = CreateListNode(3);
     var         ans  = s.ReverseListRecursion(head);
     // var ans = s.ReverseList(head);
 }
コード例 #6
0
        static void TestScratch()
        {
            Scr.Scratch s     = new Scr.Scratch();
            var         chars = "12345".ToCharArray();

            s.ReverseString(chars);
            // s.printReverse("abcde".ToCharArray());
        }