c - Binary tree implementation -
i seem getting segmentation fault, , seems though error coming phone call tra, unable see wrong code have written. have no clue, want give me hint? lot.
struct node *tra(struct node * start) { struct node * current = start; homecoming current; } table ins(key_type input, table table) { if ((find(input, table)) == false) { struct node *newval = tra(table -> head, input); newval -> element = input; i have defined struct node contains head, left , right elements. know sure tra returns current when null, creating tree empty @ first, nodes empty.
there's weird stuff going on there.
if (current == null) homecoming current; why return current? current null?
struct node *new = tra(table -> head, input); tra takes single argument?
i'd recommend utilize gdb. larn utilize now, , give powerfulness reply question yourself. it's not difficult.
c binary-tree binary-search-tree
No comments:
Post a Comment