Leetcode 938- Binary Search Tree | Range Sum BST

preview_player
Показать описание
Topic: Binary Search Tree, Depth First Search

Code:

Leetcode:

*Note* I claim no rights to this question. All rights belong to Leetcode. If I'm reviewing a solution that was from another Leetcode user or Leetcode itself I will give credit below.

Credit to :
Рекомендации по теме
Комментарии
Автор

Hey Appreciate the time you took to make a video. Will look forward to more material by you

haad
Автор

There is an error before adding the value to res we must check if it lies in the range or not...

if(root.val >= L && root.val <= R)
res+=root.val

ranajitmukherjee
Автор

This video is awsm, watching leetcode solutions explained over whiteboard really helps a me a lot to understand easily

pritomdasradheshyam
Автор

Hi @NeedeshTerapalli, Could you explain how the sum is 32, by adding those node values between range 7 and 15 ?

nikhilmylarapu
welcome to shbcf.ru