how to find out the inorder successor of a node in a tree??

Answer Posted / atul kabra

Suppose we want to fint the inorder successor of N. Then
traverse one time right from N. And then traverse a left
subtree until u will get left pointer null node.

s=n->right;
while(s->left!=NULL)
s=s->left;

printf("\nInoder Successor is %d",s->info);

Is This Answer Correct ?    27 Yes 42 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of type declarations?

673


What is the difference between union and structure in c?

567


Explain b+ tree?

618


Why is c not oop?

533


What are the types of arrays in c?

619






Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250

1499


What is the scope of an external variable in c?

563


Why do some versions of toupper act strangely if given an upper-case letter?

627


Is c high or low level?

573


write a program to copy the string using switch case?

2395


What is the difference between printf and scanf )?

585


Tell me when would you use a pointer to a function?

601


What are the application of c?

637


What is a static function in c?

614


Write a code to remove duplicates in a string.

623