4

Is there a way to reconstruct a binary tree just from its in-order representation?

I've searched the internet, but I could only find solutions for reconstructing a binary tree from inorder and preorder representations, but none for only inorder.

Gilles 'SO- stop being evil'
  • 44,159
  • 8
  • 120
  • 184

1 Answers1

6

**Example Trees**

The in-order traversal is not unique. The above trees have the same sequence 1,2,3,4,5. (They are isomorphic, but I assumed you consider ordered binary trees.)

Raphael
  • 73,212
  • 30
  • 182
  • 400
A.Schulz
  • 12,252
  • 1
  • 42
  • 64