Segment Tree | Update Query | Story To Code | Video 2
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 2nd video of our playlist "Segment Tree Concepts & Questions". Find the Details below :
Video Name : Segment Tree | Update Query | Story To Code | Video 1
Video # : 2
🔍 Unraveling Segment Tree : A Journey into the Depths of Code
🎥 Welcome to the 2nd Video of my Segment Tree Concepts & Questions Playlist! 🚀 In this enlightening video, we will see how segment trees help to do update query operations efficiently.
🔍 What's Inside ?
🔗 We will see how segment trees help to do update query operations efficiently.
👩💻 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!
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 : In this video we will see how segment trees help to do update query operations efficiently. We will also see how in the "Range Sum Query" problem, the update query is O(n) and how segment tree helps to reduce this time to O(log(n)). We will understand it from the tree diagram and also convert the story to code to write the updateSegmentTree function.
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
✨ Timelines✨
00:00 - Introduction
1:11 - Why Prefix array takes O(n) update time
5:34 - Segment Tree comes to action
8:38 - Visualise from Tree Diagram
14:27 - Story To Code
19:54 - Time Complexity O(log(n))
#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
So excited to conquer this data structure as well! 🎉
Maza aagya bhaiya , You are the best , please segment tree pura daal dijiye jldi
festival k din bhi time nikal rahe ho bhai video k lie. hats off to you.
hats off to your explanation
You make each and every topics a piece a cake
amazing
please complete dp concept playlist
awesome yaar. This playlist is a blessing 😇😇 Please keep constructing this playlist.
#NeverBackDownNeverGiveUp
Hats of to your consistency bhaiya !!
I was waiting for the part 2. Understood the whole concept . Need more such videos please❤❤
waiting for remaining lectures to come as soon as possible❤❤
thank you
Great video 👍🏻
Is consistency ko salute hai yaar 🫡
Har din video bana and that too good is not an easy task
Man you are the best teacher on .You can understand anyone and the way of teaching is superb top notch...
Well explained understood 👏 🎉
Post daily ❤❤
completed this also....next lecture sir....thankyou soo much...
Please try to upload each contest solution this will be more helpful for us
Crystal clear ❤
Bhaiya please continue dp concept playlist
❤❤
Thanks a lot
bhai live coding kyu nhi krte that was the best part? do that also , btw as always content is very good
Mik just a small request from my side, Please Complete the Dp concepts and Questions vaala playlist as soon as possible.
❤
Hello mazhar bhai
mik bhaiya make questions like sort till a given index
please upload new video ... questions practice 🤩🤩🤩🤩
Bhaiya please *longest valid parantheses* Q bataiye please
Please solve question also for this topic
Early waiting for 3rd video, kab aa rh hai
Bro will you explain leetcode's latest weekly contest Q3 and 4?
3rd part kb ayga sir?
bhaiya segment tree ka next video daal do raha nhi jaa raha
Aaj 17 Jun ka daily challenge nahi aya aaj ?
channel me jakar community section me click karo, waha dala hai aaj k POTD ka post
void build(int ind,int low,int high, int arr[], int seg[]){
if(low==high){
seg[ind]=arr[low];
return;
}
int mid=(low+high)/2;
build(2*ind+1,low,mid,arr,seg);
build(2*ind+2,mid+1,high,arr,seg);
seg[ind]=min(seg[2*ind+1],seg[2*ind+2]);
}
int query(int ind,int low,int high, int l, int r, int seg[]){
//no overlap
// [l,r] [low,high] || [low,high] [l,r]
if(r
❤