Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / shruti

inorder trraversal is
left - vertex - right.

hence to find the successor of a node.

consider N node . we have to find the inorder successor of
N.
then,

if(n -> right != NULL)
n = n -> right. /* this is the successor of n.
else
{
n = pop();
(/* we have to pop the address of the node above n, which
we have pushed earlier while traversing leftwards*/)
/*n will be hte successor node.
}


in inorder traversal we have number in ascending order in a
binary search tree.
hence the successor always is to the right, if exists,
or one level above.

**Go through the inorder traversal program to get a better
picture.

Is This Answer Correct ?    11 Yes 27 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hai what is the different types of versions and their differences

1979


What is "Hungarian Notation"?

1172


What does volatile do?

1047


Are there namespaces in c?

1193


When should the const modifier be used?

1156


By using C language input a date into it and if it is right?

1136


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

1311


Are pointers integer?

1080


What are types of preprocessor in c?

1116


Explain the use of 'auto' keyword in c programming?

1186


What are the similarities between c and c++?

1141


What is c++ used for today?

1157


write a c program to find the sum of five entered numbers using an array named number

2209


What is the use of a conditional inclusion statement in C?

1117


What is || operator and how does it function in a program?

1165