exercism / exercism/problem-specifications

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

Open
#1,826 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
358
Forks
563
Avg merge
18h 41m
Merged PRs (30d)
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.