AMAZON CODING INTERVIEW QUESTION - SUBTREE OF ANOTHER TREE
10% OFF ROOFTOP SLUSHIE: https://bit.ly/kevinnaughton
SOCIAL
----------------------------------------------------------------------------------------------------------------
Instagram: https://instagram.com/kevinnaughtonjr/
Twitter: https://twitter.com/KevinNaughtonJr
Patreon: https://www.patreon.com/KevinNaughtonJr
Merch: https://teespring.com/stores/kevin-naughton-jrs-store
GitHub: https://github.com/kdn251
This is one of Amazon's most commonly asked interview questions according to LeetCode (2020)! Subtree of another tree coding solution. If you give me 10 minutes you'll thank me if this appears during your Amazon interview! Coding Interviews subtree of another tree (LeetCode) question and explanation.
DISCORD CHANNEL
----------------------------------------------------------------------------------------------------------------
To join the Discord channel use the following link and join the "Member" tier: https://www.patreon.com/KevinNaughtonJr In this Discord channel, you will be able to...
1. Ask me questions directly (as well as other members)
2. Ask about and discuss previous interview experiences
3. Find mock interview partners
4. Share helpful videos for interview preparation, and more!
This question is commonly asked by the following companies: Amazon and Microsoft.
Link to problem: https://leetcode.com/problems/subtree-of-another-tree/
Intuition behind solution: For every node within S, ask if T and S are the same tree starting at that node by calling a recursive function. If the two node's values are the same, continuously call your recursive function otherwise if one is null and the other is not or their values don't match, return false. Once that recursive call returns, if it returned true, return true for the outer function, otherwise call you top level function again recursively moving onto descendants of the current node asking the same question again: "are S and T the same tree". If you exhaust all nodes of S asking that question and have never returned true, return false (i.e. if S == null)
MUSIC
----------------------------------------------------------------------------------------------------------------
The Deli - Izzo FT. Biggie Smalls (Prod. by Kevs) by .Kev
https://soundcloud.com/just-an-phank-fan/the-deli-izzo-ft-biggie-smalls-prod-justanphankfan
#techinterviews #leetcode #amazoninterview
Видео AMAZON CODING INTERVIEW QUESTION - SUBTREE OF ANOTHER TREE канала Kevin Naughton Jr.
SOCIAL
----------------------------------------------------------------------------------------------------------------
Instagram: https://instagram.com/kevinnaughtonjr/
Twitter: https://twitter.com/KevinNaughtonJr
Patreon: https://www.patreon.com/KevinNaughtonJr
Merch: https://teespring.com/stores/kevin-naughton-jrs-store
GitHub: https://github.com/kdn251
This is one of Amazon's most commonly asked interview questions according to LeetCode (2020)! Subtree of another tree coding solution. If you give me 10 minutes you'll thank me if this appears during your Amazon interview! Coding Interviews subtree of another tree (LeetCode) question and explanation.
DISCORD CHANNEL
----------------------------------------------------------------------------------------------------------------
To join the Discord channel use the following link and join the "Member" tier: https://www.patreon.com/KevinNaughtonJr In this Discord channel, you will be able to...
1. Ask me questions directly (as well as other members)
2. Ask about and discuss previous interview experiences
3. Find mock interview partners
4. Share helpful videos for interview preparation, and more!
This question is commonly asked by the following companies: Amazon and Microsoft.
Link to problem: https://leetcode.com/problems/subtree-of-another-tree/
Intuition behind solution: For every node within S, ask if T and S are the same tree starting at that node by calling a recursive function. If the two node's values are the same, continuously call your recursive function otherwise if one is null and the other is not or their values don't match, return false. Once that recursive call returns, if it returned true, return true for the outer function, otherwise call you top level function again recursively moving onto descendants of the current node asking the same question again: "are S and T the same tree". If you exhaust all nodes of S asking that question and have never returned true, return false (i.e. if S == null)
MUSIC
----------------------------------------------------------------------------------------------------------------
The Deli - Izzo FT. Biggie Smalls (Prod. by Kevs) by .Kev
https://soundcloud.com/just-an-phank-fan/the-deli-izzo-ft-biggie-smalls-prod-justanphankfan
#techinterviews #leetcode #amazoninterview
Видео AMAZON CODING INTERVIEW QUESTION - SUBTREE OF ANOTHER TREE канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
AMAZON CODING INTERVIEW QUESTION - REORGANIZE STRINGLargest BST in a Binary Tree | BST | Love Babbar DSA Sheet | Amazon🔥GOOGLE - MAXIMUM DEPTH OF BINARY TREE (LeetCode)AMAZON CODING INTERVIEW QUESTION - STRING COMPRESSIONWhatsapp System Design: Chat Messaging Systems for InterviewsAmazon System Design Interview: Design Parking GarageFACEBOOK CODING INTERVIEW QUESTION - VALIDATE BINARY SEARCH TREEFACEBOOK - KTH SMALLEST ELEMENT IN A BST (LeetCode)Binary Tree - 80: Check if given Tree is Sub-Tree of Main Tree in Binary TreeConstruct Binary Tree from Inorder and Preorder Traversal - Leetcode 105 - PythonAMAZON - MINIMUM PATH SUM (LeetCode)Serialize & Deserialize A Binary Tree - Crafting Recursive Solutions To Interview ProblemsWhy you're failing coding interviews...GOOGLE PHONE INTERVIEW QUESTION - LARGEST VALUES FROM LABELSLowest Common Ancestor of a Binary Search Tree - Leetcode 235 - PythonGOOGLE CODING INTERVIEW QUESTION - SHORTEST WAY TO FORM STRINGParking Lot Design | Object Oriented Design Interview QuestionAMAZON CODING INTERVIEW QUESTION - ROTTING ORANGESAMAZON - BINARY TREE PATHS (LeetCode)