GOOGLE - SAME TREE (LeetCode)
This is one of Google's most commonly asked interview questions according to LeetCode (2019)! Same Tree coding solution. If you give me 5 minutes you'll thank me if this appears during your interview! Coding Interviews Same 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: Google, Amazon, and Apple.
Link to problem: https://leetcode.com/problems/same-tree/
Intuition behind solution: Think about the base cases and your recursive calls!
Base cases:
1. Are both trees null then return true
2. Are either null then return false
3. Are the two nodes' values not the same then return false
4. Return the result of your two recursive calls checking if the current node's left and right subtrees are the same!
SOCIAL
----------------------------------------------------------------------------------------------------------------
Support me on Patreon: https://www.patreon.com/KevinNaughtonJr
Follow me on Twitter: https://twitter.com/KevinNaughtonJr
Follow me on Instagram: https://instagram.com/kevinnaughtonjr/
Follow me on GitHub: https://github.com/kdn251
MUSIC
----------------------------------------------------------------------------------------------------------------
lost my sword, now im a farmer by yungmaple
https://soundcloud.com/yungmaple/lost-my-sword-now-im-a-farmer
#coding #interviews #softwareengineering
Видео GOOGLE - SAME TREE (LeetCode) канала Kevin Naughton Jr.
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: Google, Amazon, and Apple.
Link to problem: https://leetcode.com/problems/same-tree/
Intuition behind solution: Think about the base cases and your recursive calls!
Base cases:
1. Are both trees null then return true
2. Are either null then return false
3. Are the two nodes' values not the same then return false
4. Return the result of your two recursive calls checking if the current node's left and right subtrees are the same!
SOCIAL
----------------------------------------------------------------------------------------------------------------
Support me on Patreon: https://www.patreon.com/KevinNaughtonJr
Follow me on Twitter: https://twitter.com/KevinNaughtonJr
Follow me on Instagram: https://instagram.com/kevinnaughtonjr/
Follow me on GitHub: https://github.com/kdn251
MUSIC
----------------------------------------------------------------------------------------------------------------
lost my sword, now im a farmer by yungmaple
https://soundcloud.com/yungmaple/lost-my-sword-now-im-a-farmer
#coding #interviews #softwareengineering
Видео GOOGLE - SAME TREE (LeetCode) канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
FACEBOOK - BINARY TREE RIGHT SIDE VIEW (LeetCode)AMAZON CODING INTERVIEW QUESTION - SUBTREE OF ANOTHER TREERecursion in Java Full Tutorial - How to Create Recursive Methods[Java] Leetcode 94. Binary Tree Inorder Traversal (Iteratively & Recursively) [Binary Tree #2]FACEBOOK CODING INTERVIEW QUESTION - VALIDATE BINARY SEARCH TREESame Tree - Leetcode 100 - PythonGOOGLE - MAXIMUM DEPTH OF BINARY TREE (LeetCode)LeetCode 105. Construct Binary Tree from Preorder and Inorder Traversal (Algorithm Explained)Binary Tree Maximum Path Sum (Animated Walkthrough) (LeetCode)How to solve (almost) any binary tree coding problemGOOGLE - BOATS TO SAVE PEOPLE (LeetCode)GOOGLE - BINARY TREE LEVEL ORDER TRAVERSAL (LeetCode)L18. Check it two trees are Identical or Not | C++ | JavaLeetCode 94. Binary Tree Inorder Traversal RECURSIVELY - Interview Prep Ep 66Game of Life - Leetcode 289 - PythonLeetcode 69. Sqrt(x)Google Engineer Explains - LeetCode #2 - Add Two Numbers - Solution (Python)LeetCode 104. Maximum Depth of Binary Tree - Interview Prep Ep 65AMAZON CODING INTERVIEW QUESTION - LONGEST COMMON PREFIX (LeetCode)