While it is true that the inorder traversal of a binary search tree produces a sorted output, is the converse also true, i.e., if the inorder traversal of a binary tree is sorted, then is it necessarily a binary search tree?
Nikhar
19
Junior Poster in Training
Recommended Answers
Jump to Postif the inorder traversal of a binary tree is sorted, then is it necessarily a binary search tree?
While that exact tree would represent a binary search tree, I'd say that it's not a binary search tree unless the algorithms used to insert and update it maintain that order. Otherwise …
All 3 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Nikhar
19
Junior Poster in Training
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.