Reproduce binary tree

tsv
1,396 views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Task

Binary tree is traversed twise:

  1. left -> root -> right (inorder)
  2. root -> left -> right (preorder)

Having two arrays you need to reconstruct this binary tree

Solution

Implemented in python

Tests

Implemented in python
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content