예제 #1
0
        public void Test1()
        {
            Person person1 = new Person(65, 200);
            Person person2 = new Person(70, 150);
            Person person3 = new Person(56, 90);
            Person person4 = new Person(75, 190);
            Person person5 = new Person(60, 95);
            Person person6 = new Person(68, 110);
            List<Person> list = new List<Person> { person1, person2, person3, person4, person5, person6 };

            var result = _07.tallestTower(list);
            Assert.IsTrue(result.SequenceEqual(new List<Person> { person3, person5, person6, person2, person4 }));
        }
예제 #2
0
        public void TestLongestSubsequence()
        {
            Person person1 = new Person(1, 20);
            Person person2 = new Person(2, 30);
            Person person3 = new Person(3, 40);
            Person person4 = new Person(4, 10);
            Person person5 = new Person(5, 20);
            Person person6 = new Person(6, 30);
            Person person7 = new Person(7, 40);
            Person person8 = new Person(8, 50);

            List<Person> list = new List<Person> { person1, person2, person3, person4, person5, person6, person7, person8 };
            List<Person> result = _07.longestIncreasingSubsequenceWeight(list);
            Assert.IsTrue(result.SequenceEqual(new List<Person> { person4, person5, person6, person7, person8 }));
        }