/** * 10 * / \ * 5 - * / \ * 1 - * / \ * - - */ void test_printLinear_given_3_nodes_parents_leftChild_left_grandChild() { printf("test_printLinear_given_3_nodes_parents_leftChild_left_grandChild\n\n"); Node leftgrandChild = {NULL,NULL,1}; Node leftChild = {&leftgrandChild,NULL,5}; Node root = {&leftChild,NULL,10}; printLinear(&root); printf("\n______________________________________________________\n\n"); }
void printLinear(Node *node) { if(node != NULL) { printLinear(node->left); printf("Node : %d\n" , node->data); } }