GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Placement Papers  >  Birlasoft
Next Question 
 Birlasoft  |  Question 1 of 4    Print  
How can we insert the following numbrs 7,5,1,8,3,2 in a binary tree so that inorder and preorder traversal is same

  
Total Answers and Comments: 6 Last Update: May 29, 2007     Asked by: sumant 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 04, 2005 22:12:48   #1  
gheibia Member Since: November 2005   Contribution: 3    

RE: how can we insert the following numbrs 7,5,1,8,3,2...
The Inorder: 7 5 3 1 8 2The preorder: 8 5 2 7 1 3
 
Is this answer useful? Yes | No
December 13, 2005 05:42:25   #2  
vikrant        

RE: how can we insert the following numbrs 7,5,1,8,3,2...
I think answer to it put every node on rightside 7-->5-->1-->8....then its preoder and inoder will be same
 
Is this answer useful? Yes | No
February 21, 2006 05:46:15   #3  
krishna prasad        

RE: how can we insert the following numbrs 7,5,1,8,3,2...
first we place the numbers from starting. if the next no is larger than the before no,then we place the no inright side of the before no. if it is less place left side of the no. inthis way we place the no's.
 
Is this answer useful? Yes | No
June 10, 2006 08:16:46   #4  
coder        

RE: how can we insert the following numbrs 7,5,1,8,3,2...
inorder = Me Left Rightpreorder = Left Me Rightif inorder == preorderthen Left = Empty Spaceso , we have to insert in order of1,2,3,5,7,8
 
Is this answer useful? Yes | No
February 13, 2007 01:01:53   #5  
mukesh_patel_IEC        

RE: how can we insert the following numbrs 7,5,1,8,3,2...
arrange 7-5-1---- in the rightmost of tree so that the preorder and inordered traversal is same..
 
Is this answer useful? Yes | No
May 29, 2007 03:10:14   #6  
prakasah        

RE: how can we insert the following numbrs 7,5,1,8,3,2...
inorder:-758312  preorder:-853721 or depends upon how u make the tree
inorder:-751328  preorder:-12578

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
Related Categories
Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape