diff options
Diffstat (limited to 'find_champion_2.c')
-rw-r--r-- | find_champion_2.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/find_champion_2.c b/find_champion_2.c index a6282bb..d25c7b3 100644 --- a/find_champion_2.c +++ b/find_champion_2.c @@ -28,13 +28,13 @@ int findChampion(int n, int **edges, int edgesSize, int *edgesColSize) { int main() { int e1i[2][2] = {{0, 1}, {1, 2}}, e2i[3][2] = {{0, 2}, {1, 3}, {1, 2}}; - struct two_d_arr e1, e2; - two_d_arr_init(&e1, 2, 2, e1i); - two_d_arr_init(&e2, 3, 2, e2i); - printf("%d\n", findChampion(3, e1.arr, e1.row_size, e1.col_size)); // expect: - // 0 + struct two_d_arr *e1 = two_d_arr_init(2, 2, e1i); + struct two_d_arr *e2 = two_d_arr_init(3, 2, e2i); printf("%d\n", - findChampion(4, e2.arr, e2.row_size, e2.col_size)); // expect: -1 - two_d_arr_free(&e1); - two_d_arr_free(&e2); + findChampion(3, e1->arr, e1->row_size, e1->col_size)); // expect: + // 0 + printf("%d\n", + findChampion(4, e2->arr, e2->row_size, e2->col_size)); // expect: -1 + two_d_arr_free(e1); + two_d_arr_free(e2); } |