exercism / exercism/problem-specifications

[Binary Search Tree][c language] new test case

Ouverte
#1,826 5 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Ruby
Étoiles
358
Forks
563
Merge moyen
18 h 41 min
PR mergées (30 j)
2

Description

Inspired by @siebenschlaefer comment https://exercism.io/my/solutions/b6f9db46186547ba9a7bbebf3f193078?iteration_idx=1

It looks like there is a missing test case:
```C
int tree_data[] = { 3, 1, 2 };
node_t *tree = build_tree(
tree_data, ARRAY_SIZE(tree_data));

int expected[] = { 1, 2, 3 };
int *actual = sorted_data(tree);
TEST_ASSERT_EQUAL_INT_ARRAY(
expected, actual,
ARRAY_SIZE(expected));

free_tree(tree);
free(actual);
```
I had created initially a wrong algorithm for the left and right branches. Where the left branch passe because there was a missing test case, while the right branch I fixed. Adding this test case will help to write a proper implementation.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.