Segmentation Fault

my code is giving segmentation fault when I am trying to delete root node.
my code:- https://ide.codingblocks.com/s/281781

hello @D19APPND0003
build a normal bst (i,e by perfroming insertion one by one)
and then apply ur logic

image

conditions are not correct , so modify this as well.

I have made some changes , it is passing for sample case but not on submit

hey u r again constructing tree using array trick .
what i m saying is to iterate from i=0 to n-1 and insert each element in ur bst.

once check this ->