Segment Tree LeetCode 307. Range Sum Query - Mutable Explanation and Solution

preview_player
Показать описание
OUTLINE:
0:00 - Introduction
2:13 - Segment Tree
4:41 - MLE Solution
7:36 - Using TreeNode
10:37 - Coding

Reference:

Thanks in advance. :D

Happy coding every day!
#SegmentTree #Algorithms #LeetCode
Рекомендации по теме
Комментарии
Автор

Thank you so much. This video helped me understand that we can do any operations such as min/ max/ sum on elements and propagate up using Segment trees. For min, default value is MAX_VALUE, for max, default value is MIN_VALUE and for sum, default value is 0.

parthamishra
Автор

Thank you. Was looking to Segment Trees

psn
Автор

Thank u so much!! Pretty clear explanation

sourav_ghosh
Автор

I prefer Fenwick tree for rangesum queries due to ease of implementation

sharfuddinmohammed
Автор

query(i, j) = preSum[j] - preSum[i - 1]

hqdevelopers
join shbcf.ru