Комментарии:
Coolll easiest explanation on internet
ОтветитьThank You So Much for this wonderful video.......🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
Ответитьur explanations are not clear and understandable you should be first clear urself and then teach others
ОтветитьThank you Nick!
ОтветитьWhy code in this video get stack over flow?
ОтветитьPretty stupid explanation tbh
ОтветитьHis attitude is kind of the worse, It's extremely hard to get through this because of it. I can feel condescension permeating this video.
Ответитьf
ОтветитьThanks Nick. You are awesome! Constructing Binary Tree from PostOrder and Inorder is very similar to this problem. In PostOrder, the sequence is "left, right, center", which means we need to loop PostOrder array from the end. Recursive inputs to root.left and root.right will also differ accordingly (but very similar to this video).
ОтветитьNot sure how he has so much followers. The solutions are either taken from solution or reporduced from memory without any explanations.
ОтветитьThanks for all ur work!
Ответитьcomplex
ОтветитьYeah, this was a doozy
ОтветитьThank you ! really helpful!
ОтветитьYour solutions always explain the intuition behind the solution.
ОтветитьGood explanation of preorder, inorder and postorder
ОтветитьBeauty Nick !!
ОтветитьNick, can you share your 2ms submission? Thanks
ОтветитьAnyone think question is hard? I even saw this video and I still don’t get it.
ОтветитьSorry but this video sucks. This seems like some crappy memorization over understanding approach.
ОтветитьYour solution is always very concise. I was coding it and got all the index mangled up. Thanks for the video!
ОтветитьYou can convert the in order array to a hash map storing {inorder val : index} to avoid looping through the in order array each time
ОтветитьNice Video, gr8 explaination
Ответитьyou get my stuff. Watch and subscribe so that I can grow my thing. What is he referring to
Ответитьthanks nick
Ответитьnot sure why people dislike these videos?
ОтветитьBut in other sites like gfg they are passing preStart as prestart+1 in both root->left and root->right and still giving correct output. Can you explain why?
Ответитьgood explaination!
ОтветитьReview
ОтветитьKevin >> Nick
ОтветитьThanks for simplifying the problem!! Can you tell time complexity and space complexity of this?
ОтветитьIs there a way to improve look up for the inIndex?
ОтветитьYou can save the value and index lookup for the inorder in a hashmap to avoid the for loop in your recursive stack.
Ответитьcould you please zoom out a little further, please? Who wants to see what's being typed on the screen anyways
Ответить(inIndex - inStart) is basically leftSubTreeCount which is here only 1 as there is only 1 node i.e. 9 on the left side of 3. So, that's why preorder start value will be preStart + leftSubtreeCount + 1 here.
ОтветитьAwesome explanation. Thanks
Ответитьso u knoe how to reverse a linked list, but do u knoe how to design a large scale software system
ОтветитьMan! It does not look like you in this video, you must have drive some vodka...
ОтветитьI think the `preStart>preorder.length-1` check is not needed at all. For the left downward calls, eventually inEnd will reach 0 & it will base case out because inEnd decreases & inStart does not. For the right downward calls, inStart will base case out because it increases & inEnd does not. Also FYI it sort of feels like you're "just" reading us the solutions shown on Leetcode during some parts of the video (breaking eye contact & reading the other person's answer as a reference/running into various errors/erratic explanations). Overall its a great video, this is just some constructive criticism.
ОтветитьIt took me 1 hour to do this problem, and you just did it in 11 minutes DAM
ОтветитьJust subscribed cause you said you can grow as you get more subscribers LOL We will help your channel grow, you help us learn data structures and algorithms. I appreciate you teaching us these concepts.
ОтветитьGreat video!!! I took a while to understand the concept. Can you tell what is the time and space complexity for this approach?
ОтветитьMost of this explanation just bounced over my head! Hey Nick, can you please explain the algorithm a bit more clearly, before getting into the code. Because end of the day, logic and derivation of the solution is what matters right, and coding will be easy after that! Thanks for the video though.
Ответитьgood explanation but the screen is far....i can't see obviously
ОтветитьIn line 29, where does inIndex - inStart + 1 come from? In other words, how do you map inorder index to preorder index?
Ответитьnailed it . thanks for the clear explaination
ОтветитьThanks for the video, it helped me. Do you know what would be the approach if the array would have repeated elements? (or the work around)
Ответитьit is hard to understand the formula for the prestart of the right nodes. My solution was passing prestart as reference and increment its by 1 for every-time a node is created. Thank you for your video.
ОтветитьI find that the main time cost in this solution is from the for loop search part, you can reduce the time cost by using a hashmap for inorder element search.
Ответить