-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.cpp
26 lines (23 loc) · 911 Bytes
/
Test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "Test.h"
void test()
{
int arr1[] = { 100, 90, 70, 80, 85, 65, 40, -1, -1, -1, -1, -1, -1, -1, -1};
int arr2[] = { 100, 90, 70, 80, 85, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1};
int arr3[] = { 100, 90, 70, 80, 85, 65, 54, 33, 32, 28, 39, 32, 27, 35, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
int arr4[] = { 100, 90, 70, 80, 85, 65, 54, 33, 32, 28, 39, 32, 27, 35, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
int arr5[] = { 100, 90, 70, 90, 85, 65, 40, -1, -1, -1, -1, -1, -1, -1, -1};
int arr6[] = { 100, 90, 70, 91, 85, 65, 40, -1, -1, -1, -1, -1, -1, -1, -1};
if(isMaxHeap(arr1)
&& isMaxHeap(arr2)
&& isMaxHeap(arr3)
&& !isMaxHeap(arr4)
&& isMaxHeap(arr5)
&& !isMaxHeap(arr6)
)
{
cout<<"Test: Pass"<<endl;
}else
{
cout<<"Test: Fail"<<endl;
}
}