title

L34. Construct a Binary Tree from Preorder and Inorder Traversal | C++ | Java

description

Entire DSA Course: https://takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/
Check our Website: https://www.takeuforward.org/
Linkedin/Instagram/Telegram: https://linktr.ee/takeUforward
#treeSeries #striver #placements

detail

{'title': 'L34. Construct a Binary Tree from Preorder and Inorder Traversal | C++ | Java', 'heatmap': [{'end': 874.729, 'start': 845.723, 'weight': 0.874}, {'end': 998.94, 'start': 893.078, 'weight': 0.87}], 'summary': 'Discusses the shift in hiring trends, showcasing companies like google, apple, and starbucks hiring based on skills and highlights the impact of releval, backed by unacademy, enabling candidates to take a test and connect with 50+ companies. it also explains constructing a binary tree from inorder and preorder traversal, emphasizing the unique nature of the binary tree and the recursive approach to solving the problem, along with the process of creating subtrees from in-order and pre-order traversals.', 'chapters': [{'end': 30.617, 'segs': [{'end': 30.617, 'src': 'embed', 'start': 0.009, 'weight': 0, 'content': [{'end': 3.973, 'text': "So before starting this video, I'd love to thank Releval for sponsoring this entire tree series.", 'start': 0.009, 'duration': 3.964}, {'end': 9.039, 'text': 'Did you know that companies like Google, Apple, Starbucks are now hiring people without any degree or experience?', 'start': 4.154, 'duration': 4.885}, {'end': 12.803, 'text': 'Why?? Because they believe that skills are more important than anything else.', 'start': 9.359, 'duration': 3.444}, {'end': 19.73, 'text': 'Now, top companies in India, like the top startups, have also started following this trend by hiring through a platform, which is Releval,', 'start': 13.143, 'duration': 6.587}, {'end': 20.952, 'text': 'which is backed up by Unacademy.', 'start': 19.73, 'duration': 1.222}, {'end': 25.154, 'text': 'all you have to do is to give the relevel test and, based on your score, just flat.', 'start': 21.272, 'duration': 3.882}, {'end': 30.617, 'text': 'send your candidate profiles to 50 plus companies, which includes cred, upgrade, vedantu, razor, pay, etc.', 'start': 25.154, 'duration': 5.463}], 'summary': 'Top companies are hiring based on skills; releval sends profiles to 50+ companies', 'duration': 30.608, 'max_score': 0.009, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ9.jpg'}], 'start': 0.009, 'title': 'Changing hiring trends', 'summary': 'Discusses the shift in hiring trends, showcasing companies like google, apple, and starbucks hiring based on skills. it also highlights the impact of releval, backed by unacademy, enabling candidates to take a test and connect with 50+ companies.', 'chapters': [{'end': 30.617, 'start': 0.009, 'title': 'Releval: changing hiring trends', 'summary': "Discusses how companies like google, apple, and starbucks are hiring individuals without degrees or experience based on skills. it highlights the shift in india's top companies and startups adopting this trend through releval, backed by unacademy, allowing candidates to take a test and then sending their profiles to 50+ companies.", 'duration': 30.608, 'highlights': ['Releval, sponsored by Unacademy, is changing hiring trends by allowing candidates to take a test and sending their profiles to 50+ companies, including cred, upgrade, vedantu, razor, pay, etc.', 'Companies like Google, Apple, and Starbucks are hiring people without degrees or experience based on the belief that skills are more important than qualifications.']}], 'duration': 30.608, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ9.jpg', 'highlights': ['Companies like Google, Apple, and Starbucks are hiring people without degrees or experience based on the belief that skills are more important than qualifications.', 'Releval, sponsored by Unacademy, is changing hiring trends by allowing candidates to take a test and sending their profiles to 50+ companies, including Cred, Upgrade, Vedantu, Razorpay, etc.']}, {'end': 638.052, 'segs': [{'end': 85.492, 'src': 'embed', 'start': 54.471, 'weight': 3, 'content': [{'end': 61.976, 'text': "So if you haven't seen my previous video, can you construct a unique binary tree from any given two pairs of traversal?", 'start': 54.471, 'duration': 7.505}, {'end': 69.94, 'text': 'you should definitely check it out, because if you watch that video out, you can understand if an inorder and a preorder traversal is given,', 'start': 61.976, 'duration': 7.964}, {'end': 75.023, 'text': 'then the binary tree that you create will always be an unique binary tree.', 'start': 69.94, 'duration': 5.083}, {'end': 85.492, 'text': 'Now, what you will be given is an inorder traversal of any given tree and a preorder traversal of the same given tree that for whose the inorder traversal is given.', 'start': 75.444, 'duration': 10.048}], 'summary': 'Unique binary tree can be constructed from given inorder and preorder traversals.', 'duration': 31.021, 'max_score': 54.471, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ54471.jpg'}, {'end': 287.286, 'src': 'embed', 'start': 260.17, 'weight': 0, 'content': [{'end': 265.814, 'text': 'Now, what was the initial problem that we started off with? We started off with, we have an inorder, we have a preorder.', 'start': 260.17, 'duration': 5.644}, {'end': 271.117, 'text': 'And we were required to construct this particular binary tree.', 'start': 266.594, 'duration': 4.523}, {'end': 273.338, 'text': 'So what I did was, I just did one step.', 'start': 271.337, 'duration': 2.001}, {'end': 276.28, 'text': 'I just made sure I figured out the root.', 'start': 274.599, 'duration': 1.681}, {'end': 277.22, 'text': 'That was very simple.', 'start': 276.5, 'duration': 0.72}, {'end': 279.381, 'text': 'The starting element will always be the root.', 'start': 277.48, 'duration': 1.901}, {'end': 282.543, 'text': 'And what I did was, I segregated the left and right part.', 'start': 279.802, 'duration': 2.741}, {'end': 287.286, 'text': 'So can I do this similar task for 40, 20, 50? I think I can.', 'start': 282.823, 'duration': 4.463}], 'summary': 'Task: construct binary tree from inorder and preorder with initial steps and possibility for next task.', 'duration': 27.116, 'max_score': 260.17, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ260170.jpg'}, {'end': 506.466, 'src': 'embed', 'start': 480.626, 'weight': 2, 'content': [{'end': 485.872, 'text': "I'll take that as the right and I can say this will be my pre-order traversal.", 'start': 480.626, 'duration': 5.246}, {'end': 489.977, 'text': "So I've got again the in-order and I've again got the pre-order.", 'start': 486.233, 'duration': 3.744}, {'end': 496.782, 'text': 'Remember this, this, this, these guys will wait until we form the entire left sub tree.', 'start': 490.899, 'duration': 5.883}, {'end': 506.466, 'text': 'So again the question is again broken down into two sub paths where I have again an in order, again a pre order, again an in order, again a pre order.', 'start': 497.142, 'duration': 9.324}], 'summary': 'Discussing pre-order and in-order traversal for forming left sub tree.', 'duration': 25.84, 'max_score': 480.626, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ480626.jpg'}], 'start': 30.617, 'title': 'Constructing binary trees from inorder and preorder traversal', 'summary': 'Explains constructing a binary tree from inorder and preorder traversal, emphasizing the unique nature of the binary tree and the recursive approach to solving the problem. it also demonstrates the process of creating subtrees from in-order and pre-order traversals, showcasing the construction of a binary tree using these sequences.', 'chapters': [{'end': 282.543, 'start': 30.617, 'title': 'Construct binary tree', 'summary': 'Explains how to construct a binary tree from an inorder and preorder traversal, emphasizing the unique nature of the binary tree and the recursive approach to solving the problem.', 'duration': 251.926, 'highlights': ['The inorder and preorder traversal can help in constructing a unique binary tree, and the root of the binary tree is always the first element of the preorder traversal.', 'The inorder traversal divides the tree into left and right subtrees, allowing for a recursive approach to attach the left and right subtrees to the root.', 'The key to constructing the binary tree is identifying the root, and then recursively attaching the left and right subtrees based on the inorder and preorder traversal.']}, {'end': 638.052, 'start': 282.823, 'title': 'Creating subtrees from in-order and pre-order', 'summary': 'Explains the process of creating subtrees from in-order and pre-order traversals, demonstrating the construction of a binary tree using in-order and pre-order traversal sequences.', 'duration': 355.229, 'highlights': ['The chapter explains the process of creating subtrees from in-order and pre-order traversals. The transcript discusses the method of creating subtrees from in-order and pre-order traversals.', 'Demonstrates the construction of a binary tree using in-order and pre-order traversal sequences. The speaker demonstrates the construction of a binary tree using in-order and pre-order traversal sequences, showcasing the step-by-step process of creating subtrees and constructing the entire tree.', 'Explains the logic and steps to create subtrees from in-order and pre-order traversal sequences. The speaker explains the logic and steps involved in creating subtrees from in-order and pre-order traversal sequences, providing a detailed walkthrough of the process.']}], 'duration': 607.435, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ30617.jpg', 'highlights': ['The inorder and preorder traversal can help in constructing a unique binary tree, and the root of the binary tree is always the first element of the preorder traversal.', 'The key to constructing the binary tree is identifying the root, and then recursively attaching the left and right subtrees based on the inorder and preorder traversal.', 'Explains the logic and steps to create subtrees from in-order and pre-order traversal sequences. The speaker explains the logic and steps involved in creating subtrees from in-order and pre-order traversal sequences, providing a detailed walkthrough of the process.', 'Demonstrates the construction of a binary tree using in-order and pre-order traversal sequences. The speaker demonstrates the construction of a binary tree using in-order and pre-order traversal sequences, showcasing the step-by-step process of creating subtrees and constructing the entire tree.']}, {'end': 1123.477, 'segs': [{'end': 662.308, 'src': 'embed', 'start': 638.052, 'weight': 1, 'content': [{'end': 644.436, 'text': 'so 30 will be returned and the tens right will point to 30 and ultimately i can say that i have the root and i can return this root,', 'start': 638.052, 'duration': 6.384}, {'end': 646.797, 'text': 'which will be my ultimate Answer.', 'start': 644.436, 'duration': 2.361}, {'end': 653.002, 'text': 'So this is how I can create a unique binary tree from a given in order and a pre-order traversal.', 'start': 647.278, 'duration': 5.724}, {'end': 655.023, 'text': 'So how to code this?', 'start': 653.682, 'duration': 1.341}, {'end': 659.947, 'text': "I'll just give you a preview so that you can try by yourself, and then I'll be walking you through the code,", 'start': 655.323, 'duration': 4.624}, {'end': 662.308, 'text': 'but for a preview like so that you can try.', 'start': 659.947, 'duration': 2.361}], 'summary': 'Creating a unique binary tree from given traversals, with a preview for coding.', 'duration': 24.256, 'max_score': 638.052, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ638052.jpg'}, {'end': 714.831, 'src': 'embed', 'start': 683.371, 'weight': 0, 'content': [{'end': 686.333, 'text': 'So you can optimize this.', 'start': 683.371, 'duration': 2.962}, {'end': 691.858, 'text': "If you're looking to find this guy across this, you just hash all the values of inorder.", 'start': 686.674, 'duration': 5.184}, {'end': 699.123, 'text': 'Since the question states that the inorder values will be unique, just hash all the values of inorder.', 'start': 692.198, 'duration': 6.925}, {'end': 706.367, 'text': 'so if you, if this number is 12, you can easily figure out where is 12 in the inorder using the hash map, like using hashing.', 'start': 699.123, 'duration': 7.244}, {'end': 714.831, 'text': 'once you figure this out, just tell these left guys that, okay, you are the new, you are the new inorder of left subtree.', 'start': 706.367, 'duration': 8.464}], 'summary': 'Optimize by hashing inorder values to locate specific numbers for efficient tree traversal.', 'duration': 31.46, 'max_score': 683.371, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ683371.jpg'}, {'end': 795.67, 'src': 'embed', 'start': 732.223, 'weight': 2, 'content': [{'end': 733.824, 'text': "so you're calling the function again.", 'start': 732.223, 'duration': 1.601}, {'end': 735.585, 'text': "so it's a kind of recursive function,", 'start': 733.824, 'duration': 1.761}, {'end': 744.798, 'text': 'and you say that this right portion is going to be my in order for the right and the remaining elements over here, like remaining elements,', 'start': 735.585, 'duration': 9.213}, {'end': 748.22, 'text': 'can be called as my pre-order for the right.', 'start': 744.798, 'duration': 3.422}, {'end': 754.746, 'text': 'so again, you just pass an in order and a pre-order for the left, for the right, and they will create themselves.', 'start': 748.22, 'duration': 6.526}, {'end': 758.469, 'text': 'that is how you generally try to write a recursive solution.', 'start': 754.746, 'duration': 3.723}, {'end': 762.392, 'text': "i'll be showing you the code and along with that i'll be doing a example dry run.", 'start': 758.469, 'duration': 3.923}, {'end': 768.173, 'text': 'So, guys, as usual, the C++ code is on the left and the Java code is on the right.', 'start': 763.41, 'duration': 4.763}, {'end': 774.476, 'text': "So we're given the pre-ordered traversal and that's the pre-ordered traversal, like the example that I'll be doing a dry run on.", 'start': 768.593, 'duration': 5.883}, {'end': 776.858, 'text': 'And that is the in-order traversal that is given to you.', 'start': 774.997, 'duration': 1.861}, {'end': 781.08, 'text': "So, initially what you'll do is the entire in-order traversal.", 'start': 777.398, 'duration': 3.682}, {'end': 782.961, 'text': 'just put that into the HashMap, okay?', 'start': 781.08, 'duration': 1.881}, {'end': 788.945, 'text': 'So assuming the in-order traversal is this and you just put it onto the HashMap.', 'start': 783.281, 'duration': 5.664}, {'end': 790.326, 'text': "You don't need to do anything else.", 'start': 789.005, 'duration': 1.321}, {'end': 795.67, 'text': 'So what I did was 0th index, 1st index, 2nd index, 3rd index, 4th index.', 'start': 791.386, 'duration': 4.284}], 'summary': 'Explanation of recursive function with example dry run in c++ and java.', 'duration': 63.447, 'max_score': 732.223, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ732223.jpg'}, {'end': 874.729, 'src': 'heatmap', 'start': 845.723, 'weight': 0.874, 'content': [{'end': 849.807, 'text': 'similarly, where is the in-starting and where is the in-order ending, along with the hash mark?', 'start': 845.723, 'duration': 4.084}, {'end': 855.114, 'text': 'Now what I am doing is what I am doing is As long as I have some pre-orders.', 'start': 850.227, 'duration': 4.887}, {'end': 859.317, 'text': "like as long as I have a pre-order, as long as I have to create a tree, I'll create.", 'start': 855.114, 'duration': 4.203}, {'end': 865.562, 'text': 'If by chance I do not have any pre-order, like I get an empty array, then I return a null.', 'start': 859.977, 'duration': 5.585}, {'end': 867.483, 'text': "As I said, in the last step I'll be returning a null.", 'start': 865.682, 'duration': 1.801}, {'end': 869.865, 'text': "Or else what I'll do is, I'll create the root.", 'start': 867.984, 'duration': 1.881}, {'end': 874.729, 'text': "So let's assume, initially I got the pre-start, the pre-end.", 'start': 870.125, 'duration': 4.604}], 'summary': 'Algorithm creates a tree from preorder data, handling empty arrays by returning null.', 'duration': 29.006, 'max_score': 845.723, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ845723.jpg'}, {'end': 998.94, 'src': 'heatmap', 'start': 893.078, 'weight': 0.87, 'content': [{'end': 896.6, 'text': "so this is my initial root that's created on the first level of recursion call.", 'start': 893.078, 'duration': 3.522}, {'end': 900.523, 'text': 'Next I say hey, can you figure out where is the in root??', 'start': 897.461, 'duration': 3.062}, {'end': 901.844, 'text': 'Like, where is the in order??', 'start': 900.863, 'duration': 0.981}, {'end': 903.005, 'text': 'Like, where is this 3 lying?', 'start': 901.884, 'duration': 1.121}, {'end': 906.026, 'text': 'So it says in map will say it lies over here.', 'start': 903.445, 'duration': 2.581}, {'end': 911.23, 'text': 'So this is where the in root points, because you can directly get it from here right?', 'start': 906.047, 'duration': 5.183}, {'end': 913.711, 'text': 'Now, how many numbers are on the left?', 'start': 911.59, 'duration': 2.121}, {'end': 915.232, 'text': "Isn't it very easy?", 'start': 914.212, 'duration': 1.02}, {'end': 920.436, 'text': "If you have in root and if you do the in start, like you know, it's the start pointer.", 'start': 915.673, 'duration': 4.763}, {'end': 923.458, 'text': "So, if you figure out, you'll get the number of left is.", 'start': 920.496, 'duration': 2.962}, {'end': 926.56, 'text': 'one. there is one number on the left.', 'start': 924.558, 'duration': 2.002}, {'end': 928.382, 'text': "then i'm saying root dot left.", 'start': 926.56, 'duration': 1.822}, {'end': 930.805, 'text': "why don't you again build yourself with the?", 'start': 928.382, 'duration': 2.423}, {'end': 938.032, 'text': "i'll just pass on the pre-order and i'll say this time the pre-order starts from one point and next this is my new pre-order.", 'start': 930.805, 'duration': 7.227}, {'end': 939.373, 'text': 'it starts from here.', 'start': 938.032, 'duration': 1.341}, {'end': 942.576, 'text': 'it goes on by taking one more number.', 'start': 939.373, 'duration': 3.203}, {'end': 944.819, 'text': 'so ultimately i can say this is my new pre-order.', 'start': 942.576, 'duration': 2.243}, {'end': 948.462, 'text': "So I've just taken one number and I'm saying this is my pre-order.", 'start': 945.379, 'duration': 3.083}, {'end': 953.267, 'text': "So, I'm saying next time the pre-start will be this, the pre-end will be this.", 'start': 948.742, 'duration': 4.525}, {'end': 959.373, 'text': "So, without actually reducing the array, I'm just using these two pointers to mark the reduction of the array.", 'start': 953.587, 'duration': 5.786}, {'end': 964.297, 'text': "So, you can see I've just figured out this as the new pre-order for the left guy.", 'start': 959.733, 'duration': 4.564}, {'end': 966.359, 'text': 'correct and over here.', 'start': 964.958, 'duration': 1.401}, {'end': 975.585, 'text': "what i've done is, i'm said for the next guy, the in start, like wherever i'm standing, that will be definitely my starting of the in order.", 'start': 966.359, 'duration': 9.226}, {'end': 977.886, 'text': "i'm saying in root minus one like this is the in root.", 'start': 975.585, 'duration': 2.301}, {'end': 980.527, 'text': 'this is where three exists, the root right before.', 'start': 977.886, 'duration': 2.641}, {'end': 985.971, 'text': "that is where my in order will be and that's what i'm passing to build the tree on the left.", 'start': 980.527, 'duration': 5.444}, {'end': 986.951, 'text': 'what about right?', 'start': 985.971, 'duration': 0.98}, {'end': 987.752, 'text': "it's very simple.", 'start': 986.951, 'duration': 0.801}, {'end': 988.772, 'text': "i'm saying pre-start.", 'start': 987.752, 'duration': 1.02}, {'end': 992.935, 'text': 'pre-start is 3 plus numst left.', 'start': 989.773, 'duration': 3.162}, {'end': 995.017, 'text': "that's one element plus one.", 'start': 992.935, 'duration': 2.082}, {'end': 995.658, 'text': 'that is from 20.', 'start': 995.017, 'duration': 0.641}, {'end': 998.94, 'text': "i'm starting to pre-end till this end, pointer.", 'start': 995.658, 'duration': 3.282}], 'summary': 'Recursively building a tree using pre-order and in-order traversal, with pointers and quantifiable data.', 'duration': 105.862, 'max_score': 893.078, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ893078.jpg'}, {'end': 1075.901, 'src': 'embed', 'start': 1051.907, 'weight': 5, 'content': [{'end': 1059.271, 'text': 'How have I taken the pointers in order to reduce the array without actually reducing the array?', 'start': 1051.907, 'duration': 7.364}, {'end': 1060.772, 'text': "And that's the C++ code.", 'start': 1059.571, 'duration': 1.201}, {'end': 1069.116, 'text': "So if I discuss the time complexity, it's we go of n and if you're assuming login for HashMap, you can take n login.", 'start': 1061.452, 'duration': 7.664}, {'end': 1071.117, 'text': "If you're not assuming login, you can take it as n.", 'start': 1069.396, 'duration': 1.721}, {'end': 1075.901, 'text': "Like, depending on the HashMap you're using, you can use BGov or NLogN.", 'start': 1071.437, 'duration': 4.464}], 'summary': 'C++ code reduces array size with time complexity o(n) or o(nlogn) for hashmap', 'duration': 23.994, 'max_score': 1051.907, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ1051907.jpg'}], 'start': 638.052, 'title': 'Creating a unique binary tree', 'summary': 'Discusses the process of creating a unique binary tree from given inorder and pre-order traversals, emphasizing the identification of the root node, utilizing a hash map, and achieving time complexity of o(n) and space complexity of o(n).', 'chapters': [{'end': 706.367, 'start': 638.052, 'title': 'Creating unique binary tree from inorder and preorder traversal', 'summary': 'Discusses creating a unique binary tree from a given inorder and pre-order traversal, emphasizing the process of identifying the root node and utilizing a hash map to optimize the search, ultimately leading to the successful creation of the binary tree.', 'duration': 68.315, 'highlights': ['The first step when given an inorder and a preorder is to identify the first element as the root node, followed by utilizing a hash map to optimize the search for this element across the inorder traversal. Identifying root node, Utilizing hash map for search optimization', 'The process involves pointing the tens digit to the value 30, ultimately leading to the successful creation of the unique binary tree. Pointing the tens digit to 30, Successful creation of unique binary tree', 'The chapter also outlines the approach to code the process, offering a preview for independent practice before walking through the code. Approach to coding, Providing a preview for independent practice']}, {'end': 1123.477, 'start': 706.367, 'title': 'Unique tree creation from in-order and pre-order', 'summary': 'Explains the process of creating a unique tree from in-order and pre-order traversals using a recursive function, hashmap, and pointers. it also discusses time and space complexity, with time complexity being o(n) and space complexity being o(n).', 'duration': 417.11, 'highlights': ['Using a recursive function, the chapter explains the process of creating a unique tree from in-order and pre-order traversals.', 'The explanation involves the use of a hashmap to store the in-order traversal and pointers to indicate the start and end of the pre-order and in-order.', 'The time complexity is O(n) and can be assumed as O(n log n) depending on the hashmap, while the space complexity is O(n) due to the use of a hashmap and stack space.']}], 'duration': 485.425, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aZNaLrVebKQ/pics/aZNaLrVebKQ638052.jpg', 'highlights': ['Identifying root node, Utilizing hash map for search optimization', 'Pointing the tens digit to 30, Successful creation of unique binary tree', 'Approach to coding, Providing a preview for independent practice', 'Using a recursive function, the chapter explains the process of creating a unique tree from in-order and pre-order traversals.', 'The explanation involves the use of a hashmap to store the in-order traversal and pointers to indicate the start and end of the pre-order and in-order.', 'The time complexity is O(n) and can be assumed as O(n log n) depending on the hashmap, while the space complexity is O(n) due to the use of a hashmap and stack space.']}], 'highlights': ['Companies like Google, Apple, and Starbucks are hiring people without degrees or experience based on the belief that skills are more important than qualifications.', 'Releval, sponsored by Unacademy, is changing hiring trends by allowing candidates to take a test and sending their profiles to 50+ companies, including Cred, Upgrade, Vedantu, Razorpay, etc.', 'The inorder and preorder traversal can help in constructing a unique binary tree, and the root of the binary tree is always the first element of the preorder traversal.', 'The key to constructing the binary tree is identifying the root, and then recursively attaching the left and right subtrees based on the inorder and preorder traversal.', 'Using a recursive function, the chapter explains the process of creating a unique tree from in-order and pre-order traversals.', 'The time complexity is O(n) and can be assumed as O(n log n) depending on the hashmap, while the space complexity is O(n) due to the use of a hashmap and stack space.']}