You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* inStart and inRoot-1 as new start and end indices
47
+
* inRoot+1 and inEnd as new start and end indices
48
+
*
49
+
* this is easy to understand and remember: since inRoot is already been used in this recursion call, so we're going to use inRoot-1 and inRoot+1 for next recursion call
50
+
*
51
+
* for the indices of postorder array:
52
+
* postorderStart and postorderStart+numsLeft-1 should be the new start and end indices
53
+
* postorderStart+numsLeft and postorderEnd-1 should be the new start and end indices
54
+
*
55
+
* this is also easy to understand and remember:
56
+
* since the last one in postorder is the root and we have used it in this recursion call already, so the end is definitely postorderEnd-1;
57
+
* then the postorderEnd for root.left is contiguous to the postorderStart of root.right, :)*/
0 commit comments