1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <stdio.h> #include <stdlib.h> #include "node.h" void main() { struct _node *root = NULL; int val; for (int i = 0; i < 10; i++) { val = rand() % 90 + 10; printf("%5d", val); root = add_val(root, val); } printf("\n"); show_node(root); printf("\n"); free_node(root); }