Doubt:deletion in bst

code: https://ide.codingblocks.com/s/151452
why is it giving wrong output ?