Example #1
0
        public void SearchInsertTest()
        {
            var testFunc = new ArrayQ();

            Assert.AreEqual(2, testFunc.SearchInsert(new int[] { 1, 3, 5, 6 }, 5));
            Assert.AreEqual(1, testFunc.SearchInsert(new int[] { 1, 3, 5, 6 }, 2));
            Assert.AreEqual(4, testFunc.SearchInsert(new int[] { 1, 3, 5, 6 }, 7));
            Assert.AreEqual(0, testFunc.SearchInsert(new int[] { 1, 3, 5, 6 }, 0));
        }