Загрузка страницы

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.
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
4 апреля 2019 г. 6:30:02
00:06:45
Яндекс.Метрика