end i can say i have actually printed my inorder traversal so if you draw the recursion tree you'll actually see the same stack trace the same stack trace being created so as usual the c plus plus code is on the left and the java code is on the right so what are we given we're given the root of the tree right and we take a stack empty stack i create a node which is our current or whatever you can call i can just assign it to root and i've declared a vector which stores my in order now if you remember what we did if the node is not null we took that node we put that into the stack and we moved to the left basically this creates my stack auxiliary stack trace and i move to the left perfect and at the same iteration if i end up getting to the else what does else means it means it's null right if it is null if you remember what did we do we just we will just make sure the stack is empty then it's over that means there are no nodes to travel or else whatever is at the top of the stack we take it okay and that will be my in order and after that since it is print and after that it's right i move to the right and the iteration goes over whenever the stack becomes empty i'll break out once i break out i'm going to return the inorder traversal what will be the time complexity guys it's very simple it's a big go of end traversal because i'm traversing all the notes what is the space complexity it's a big of n because i am using an auxiliary stack space now why the auxiliary space is b go off and imagine you're given a tree which just has left children so you'll push this then you'll push this they will push this and you'll go to the left every time you go to the left and you're going on to push on so if there is a skew tree which is just the left children you will end up taking b go off n space or if i just summarize this i can say it's a big go of height of the binary tree is the space complexity for storing the inorder traversal so i hope you've understood the entire explanation as well as the code just in case you did please please please make sure you like this video because it took a lot of efforts to make this entire tree series also if you wish you can definitely drop in a comment that will keep motivating me to make such further series also if you're new to this channel please do consider subscribing because i'm going to bring in such more series in the upcoming future as well with this let's wrap up this video let's speed in the next lecture bye
START_INTERACTION_TOKEN i hope you've understood the entire explanation as well as the code just in case you did please please please make sure you like this video because it took a lot of efforts to make this entire tree series also if you wish you can definitely drop in a comment that will keep motivating me to make such further series also if you're new to this channel please do consider subscribing because i'm going to bring in such more series in the upcoming future as well with this let's wrap up this video let's speed in the next lecture bye END_INTERACTION_TOKEN