I'm trying recreate a binary tree given the inorder and postorder sequences with for example the inputs. inorder: abcdefghijklmn
and postorder:badfgecjimlnkh
and outputting
[h, [c, [a, None, None]], [e, [d, None, None], [g, [f, None, None], None]]], [k, [I, None, [j, None, None]], [n, [l, None, [m, None, None]], None]]]
I've created a binary tree class here https://pastebin.com/ANbVp135 but am unsure about how to go about creating a program that will recreate a tree from the postorder and inorder traversal inputs or if there is an implementation of this that already exists.
Not other previous problems discuss in and postorder, making this question unique