Query Sum II | Segment Tree Concepts & Qns | Video 5 | codestorywithMIK

Subscribers:
92,300
Published on ● Video Link: https://www.youtube.com/watch?v=VJ67kQHYbv8



Duration: 18:47
1,976 views
103


iPad PDF Notes - https://github.com/MAZHARMIK/Intervie...
Whatsapp Community Link : https://www.whatsapp.com/channel/0029...
This is the 5th video of our playlist "Segment Tree Concepts & Questions". Find the Details below :

Video Name : Query Sum II | Segment Tree Concepts & Qns | Video 5
Video # : 5

🔍 Unraveling Segment Tree : A Journey into the Depths of it.

🎥 Welcome to the 5th Video of my Segment Tree Concepts & Questions Playlist! 🚀 In this enlightening video, we will finally start solving Qns on Segment Tree. In this one, we will solve - Query Sum II | Segment Tree Concepts & Qns | Video 5 | codestorywithMIK

🔍 What's Inside ?

🔗 We will see how we can use Segment Tree concepts to easily solve this problem - Query Sum II.

👩‍💻 Who Should Watch ?

This playlist is for everyone but best suited for Freshers who are new to Segment Tree.

🚀 Embark on the Segment Tree Adventure Now!

Problem Name : Query Sum II | Segment Tree Concepts & Qns | Video 5 | codestorywithMIK Company Tags : Amazon My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Intervie... Leetcode Link : https://www.geeksforgeeks.org/problem...


My DP Concepts Playlist :    • Roadmap for DP | How to Start DP ? | ...  
My Graph Concepts Playlist :    • Graph Concepts & Qns - 1 : Graph will...  
My Recursion Concepts Playlist :    • Introduction | Recursion Concepts And...  
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Intervie...
Subscribe to my channel :    / @codestorywithmik  
Instagram :   / codestorywithmik  
Facebook :   / 100090524295846  
Twitter :   / cswithmik  


Summary : In this video, We see how we can use Segment Tree concepts to easily solve this problem - Query Sum II. This code implements a segment tree data structure to efficiently compute range sum queries on an array. The buildSegmentTree function constructs the segment tree recursively from the input array, where each node stores the sum of a segment of the array. The querySegmentTree function performs range sum queries on the segment tree. The querySum function initializes the segment tree and iterates through a list of queries to compute and return the sum for specified ranges in the array. Overall, this approach ensures that both construction of the segment tree and querying for sums are handled efficiently with O(logn) time complexity per query after an O(n) initial setup time, making it suitable for scenarios requiring frequent range sum computations on static arrays.

╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

✨ Timelines✨
00:00 - Introduction
00:12 - Motivation
01:23 - Problem Explanation
03:34 - How to Solve using Segment Tree
11:48 - Coding it up

#codestorywithMIK
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #2024 #newyear #RecursionExplained #CodingJourney #Programming101 #TechTalks #AlgorithmMastery #Recursion #Programming #Algorithm #Code #ComputerScience #SoftwareDevelopment #CodingTips #RecursiveFunctions #TechExplained #ProgrammingConcepts #CodeTutorial #LearnToCode #TechEducation #DeveloperCommunity #RecursiveThinking #ProgrammingLogic #ProblemSolving #AlgorithmDesign #CSEducation
#segmenttree #segment #rangequeries




Other Videos By codestorywithMIK


2024-07-08Crawler Log Folder | 2 Approaches | Dry Runs | Leetcode 1598 | codestorywithMIK
2024-07-07Average Waiting Time | Simple Simulation | Leetcode 1701 | codestorywithMIK
2024-07-06Range Update Query | Lazy Propagation | Segment Tree Concepts & Qns | Video 7 | codestorywithMIK
2024-07-06Find the Winner of the Circular Game | 3 Approaches | Leetcode 1823 | codestorywithMIK
2024-07-05Pass the Pillow | 2 Approaches | Easy Explanations | Leetcode 2582 | codestorywithMIK
2024-07-05Water Bottles | 3 Approaches | Easy Explanations | Leetcode 1518 | codestorywithMIK
2024-07-02Minimum Difference Between Largest and Smallest Value in Three Moves | 2 Approaches | Leetcode 1509
2024-07-02Merge Nodes in Between Zeros | 2 Approaches | Leap Of Faith | Leetcode 2181 | codestorywithMIK
2024-06-30Intersection of Two Arrays II | 2 Approaches | Easy Explanations | Leetcode 350 | codestorywithMIK
2024-06-29Longest Palindromic Subsequence | Using Blue Print | DP On Strings | Leetcode 516 | DP Concepts - 25
2024-06-28Query Sum II | Segment Tree Concepts & Qns | Video 5 | codestorywithMIK
2024-06-27All Ancestors of a Node in a Directed Acyclic Graph | 3 Approaches | Leetcode 2192 |codestorywithMIK
2024-06-26Maximum Total Importance of Roads | Thought Process | Leetcode 2285 | codestorywithMIK
2024-06-25Find Center of Star Graph | 2 Simple Approaches | Leetcode 1791 | codestorywithMIK
2024-06-24Balance a Binary Search Tree | Simple Explanation | Leetcode 1382 | codestorywithMIK
2024-06-23Binary Search Tree to Greater Sum Tree | Brute | Better | Optimal | Leetcode 1038 | codestorywithMIK
2024-06-23Minimum Number of K Consecutive Bit Flips | 3 Approaches | Detailed | Leetcode 995 | 3191
2024-06-22Segment Tree | Why size is 4*n | With Proof | Video 4
2024-06-21Count Number of Nice Subarrays | 2 Approaches | Similar Concept | Leetcode 1248 | codestorywithMIK
2024-06-21Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit | Leetcode 1438 |Detailed
2024-06-19Grumpy Bookstore Owner | Simplest Thought Process | Leetcode 1052 | codestorywithMIK