Range Minimum Query | Segment Tree Concepts & Qns | Video 6 | codestorywithMIK

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • iPad PDF Notes - github.com/MAZHARMIK/Intervie...
    Whatsapp Community Link : www.whatsapp.com/channel/0029...
    This is the 6th video of our playlist "Segment Tree Concepts & Questions". Find the Details below :
    Video Name : Range Minimum Query | Segment Tree Concepts & Qns | Video 6 | codestorywithMIK
    Video # : 6
    🔍 Unraveling Segment Tree : A Journey into the Depths of it.
    🎥 Welcome to the 6th 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 - Range Minimum Query | Segment Tree Concepts & Qns | Video 6 | codestorywithMIK
    🔍 What's Inside ?
    🔗 We will see how we can use Segment Tree concepts to easily solve this problem - Range Minimum Query
    👩‍💻 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 : Range Minimum Query | Segment Tree Concepts & Qns | Video 6 | codestorywithMIK
    Company Tags : META (slight variation)
    My solutions on Github(C++ & JAVA) : github.com/MAZHARMIK/Intervie...
    Leetcode Link : practice.geeksforgeeks.org/pr...
    My DP Concepts Playlist : • Roadmap for DP | How t...
    My Graph Concepts Playlist : • Graph Concepts & Qns -...
    My Recursion Concepts Playlist : • Introduction | Recursi...
    My GitHub Repo for interview preparation : github.com/MAZHARMIK/Intervie...
    Subscribe to my channel : / @codestorywithmik
    Instagram : / codestorywithmik
    Facebook : / 100090524295846
    Twitter : / cswithmik
    Summary :
    buildSegmentTree function: This function recursively builds the segment tree. It starts with an initial call to buildSegmentTree(0, 0, n-1, segmentTree, arr), where i is the index in the segment tree, l and r represent the range of the current segment, segmentTree is the array representing the segment tree, and arr is the original array. At each step:
    If l equals r (indicating a leaf node), the segment tree node segmentTree[i] is assigned the value of arr[l].
    Otherwise, it calculates the midpoint mid and recursively builds the left and right child nodes of the segment tree.
    constructST function: This function initializes the segment tree array and calls buildSegmentTree to construct the segment tree from the given array arr of size n. It returns the constructed segment tree.
    querySegmentTree function: This function queries the segment tree to find the minimum value in the specified range [start, end]. It uses a recursive approach:
    If the current segment [l, r] does not overlap with [start, end], it returns INT_MAX (a large integer).
    If the current segment [l, r] is completely within [start, end], it returns the value stored in the segment tree node segmentTree[i].
    Otherwise, it recursively queries both left and right children of the current node to find the minimum value in the specified range.
    RMQ function: This function serves as an interface to query the segment tree for the range minimum query (RMQ). It takes the segment tree st, array size n, and range [a, b], and internally calls querySegmentTree to retrieve the minimum element in the range [a, b].
    ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
    ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
    ╠╗║╚╝║║╠╗║╚╣║║║║║═╣
    ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
    ✨ Timelines✨
    00:00 - Introduction
    00:08 - Motivation
    00:52 - Problem Explanation
    02:03 - How to Solve using Segment Tree
    07:40 - 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

Komentáře • 20