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

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

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

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

Зарегистрируйтесь или войдите с
Информация о видео
16 апреля 2020 г. 3:00:06
00:10:47
Яндекс.Метрика