Beispiel #1
0
        public void FindMaximumKElementsInASequence_WhenKIsZero_ShouldReturnEmptyResult()
        {
            int[] data   = new int[] { 5, 8, 6, 9, 12, 11, 7, 15, 10 };
            int[] result = HeapProblemSolving.FindMaximumKElementsInASequence(sequence: data, k: 0);

            Assert.Equal(new int[] { }, result);
        }
Beispiel #2
0
 public void FindMaximumKElementsInASequence_WhenCalled_ShouldReturnMaximumKElement()
 {
     int[] data           = new int[] { 5, 8, 6, 9, 12, 11, 7, 15, 10 };
     int[] actualResult   = HeapProblemSolving.FindMaximumKElementsInASequence(sequence: data, k: 5);
     int[] expectedResult = new int[] { 15, 12, 11, 10, 9 };
     Assert.True(!expectedResult.Except <int>(actualResult).Any());
 }