About the replacement of the node

can the node to be deleted be replaced by the max value node in the left subtree of the node to be deleted as the root?

hello @Senjuti256
yeah u can do that (it is also correct),
but it will not pass any test case becuase in in test case we have considered right subtree for deletion , so ur output may not match with the test output

how to know whether in the test cases of a qstn they have replaced the node with the appropriate node of left or right subtree?

check problem they may mentioned it there.

for inorder successor ->consider right tree
for inorder predecessor ->consider left tree