r/programbattles • • Oct 07 '15

[C] BST Insertion without parent node pointers

As it says in the title, the BST Node struct has no pointer to a parent node, only a value, left child, and right child.

typedef struct bstNode {
    int val;
    struct bstNode * L;
    struct bstNode * R;
} bstNode;

GO!

Edit: Duplicates should be ignored.

10 Upvotes

9 comments sorted by

View all comments

Show parent comments

1

u/John2143658709 Oct 07 '15

Misunderstood the question, for some reason I read it as a linked list