コード例 #1
0
        public void Test3()
        {
            int[] arr = new int[] { 30, 40, 50, 10, 20 };
            int   k   = 10;

            var fr     = new FindInRotated();
            var result = fr.Find(arr, k);

            Assert.That(result, Is.EqualTo(3));
        }
コード例 #2
0
        public void Test2()
        {
            int[] arr = new int[] { 5, 6, 7, 8, 9, 10, 1, 2, 3 };
            int   k   = 30;

            var fr     = new FindInRotated();
            var result = fr.Find(arr, k);

            Assert.That(result, Is.EqualTo(-1));
        }