I wrote the code,but its not running,its giving some error.Please correct the code and tell me my mistake

Link:https://ide.codingblocks.com/s/318033

@KetanPandey
Your code was absolutely correct. There were just two small errors in the insertion function. When you checked for a left pointer and if it existed, you performed t = node->left. But if it wasnt present , you declared node n and set t->left = n. But you didnt perform t = n because of which there was an error.

The same happened for the right pointer. Please correct that and your code will work absolutely fine.
If my solution was able to answer your query, please mark the doubt as resolved.