Binary search tree question.

  • Thread starter Demonoid
  • Start date
  • #1
14
0

Homework Statement


I need to prove that different insertion orders of the same keys always gives us a different binary tree.


Homework Equations


All obvious BST properties apply:
The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only nodes with keys greater than the node's key.
Both the left and right subtrees must also be binary search trees.
There must be no duplicate nodes.

The Attempt at a Solution


I don't exactly know how to formally prove this besides just showing a bunch of examples.

I think this is obvious because there aren't any duplicate keys therefore you will always have a unique layout of the tree.
 

Answers and Replies

Related Threads on Binary search tree question.

  • Last Post
Replies
5
Views
1K
Replies
1
Views
4K
Replies
0
Views
2K
Replies
3
Views
4K
  • Last Post
Replies
1
Views
923
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
1
Views
828
  • Last Post
Replies
1
Views
1K
Replies
6
Views
771
  • Last Post
Replies
2
Views
1K
Top