data-structures · intermediate · ~15 min
Recursive tree traversal that produces output.
Given the same bst_t as the previous exercise, implement void bst_inorder(const bst_t *root, int *out, size_t *idx) that appends values in ascending order to out[*idx], advancing *idx.
#include <stddef.h>
void bst_inorder(const bst_t *root, int *out, size_t *idx) {
/* TODO */
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.