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

AMAZON - RANGE SUM OF BST (LeetCode)

SOCIAL
----------------------------------------------------------------------------------------------------------------
Instagram: https://instagram.com/kevinnaughtonjr/
Twitter: https://twitter.com/KevinNaughtonJr
Patreon: https://www.patreon.com/KevinNaughtonJr
GitHub: https://github.com/kdn251

This is one of Amazon's most commonly asked interview questions according to LeetCode (2019)! Range Sum of BST coding solution. If you give me 5 minutes you'll thank me if this appears during your Amazon interview! Coding Interviews Range Sum of BST (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, Facebook, Microsoft, and Apple.

Link to problem: https://leetcode.com/problems/range-sum-of-bst/

Intuition behind solution: Traverse the entire tree by doing a BFS, at each iteration of the BFS, add the current node's value to your running sum if its value is between L and R (inclusive). Then check if the current node has a left child and if its value could be within the range of L, if it could be add the left child to the queue to be processed. Then check if the current node has a right child and if its value could be within the range of R, if it could be add the right child to the queue to be processed. Once your BFS is finished, return your sum.

MUSIC
----------------------------------------------------------------------------------------------------------------
leanleanwalk? (IG @uwumajora) by MAJORA🌸
https://soundcloud.com/uwumajora/leanleanwalk

#techinterviews #leetcode #softwareengineer

Видео AMAZON - RANGE SUM OF BST (LeetCode) канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Введите заголовок:

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

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

Зарегистрируйтесь или войдите с
Информация о видео
11 ноября 2019 г. 7:30:00
00:08:39
Яндекс.Метрика