Im trying to traverse a binary search tree and get the depth of each node and sum them up. Im using a file which has 7 numbers "nodes"
4
6
7
5
2
3
1
the code doesn't output numbers 5 and 3 because the pointers never point to them and causes a core dump(here's my problem), how can successful traverse my tree in order to get the depth of each node?