00:02 Understanding and solving heap related problems 02:23 Understanding the concept of heap height in detail 06:55 Understanding the height formula of the heap 09:07 Logic behind multiple divisions and height calculation 13:25 Finding minimum cost of connecting ropes 15:31 Finding the minimum cost of connecting ropes 22:03 Explaining the process of shifting elements in solving a problem 25:48 Shifting elements to maintain order in a heap 28:01 Understanding and using Min Heap in priority 31:58 Priority order for inserting and removing elements in a heap 33:49 Efficiently perform log operations and cost calculations 37:35 Optimizing insertion process using priority queue 39:16 Creating and using heaps to solve problems 43:21 Magician demonstrating a chocolate eating trick with a twist 45:20 Solving chocolate distribution problem with strategic approach 49:10 Implementing a heap and sorting the elements 51:02 Understanding time complexity of heap operations 54:48 Understanding the time complexity of heap operations 56:26 Implementing priority queue utilizing heap for maintaining a min heap structure. 1:00:11 Selecting the heaviest stones based on weight. 1:02:02 Collision of stones in a heap 1:05:48 Explanation of the process of removing elements from a heap 1:07:23 Returning the top element of a priority queue after certain operations. 1:11:26 Maximize profit by selecting and selling seats strategically 1:13:21 Select the maximum value and perform delete and insert operations simultaneously. 1:16:56 Understanding and implementing heap data structure 1:18:50 Implementation of a heap algorithm
Last Stone Weight : _________________________________________________ int lastStoneWeight(vector& stones) { priority_queue q; for (int i = 0; i < stones.size(); ++i) { q.push(stones[i]); } int first = 0; int second = 0; while (q.size() > 1) { first = q.top(); q.pop(); second = q.top(); q.pop(); int dif = abs(first - second); if (dif > 0) { q.push(dif); } } return (q.size() > 0 ? q.top() : 0); }
Problem 5 : ____________________________________________ /* function parameter names have been changed for simplicity */ long long pickGifts(vector& B, int A) { priority_queue q; long long sum = 0; for(int i = 0; i
Problem 5:- long long pickGifts(vector& gifts, int k) { priority_queuep; for(long long i = 0; i< gifts.size(); i++){ p.push(gifts[i]); } while(k--){ p.push(sqrt(p.top())); p.pop(); } long long ans = 0; while(!p.empty()){ ans += p.top(); p.pop(); } return ans; }
problem no : 1 ______________________________________ long long minCost(long long arr[], long long n) { // Your code here priority_queue pq; long long int ans = 0; for(int i = 0; i 1) { first = pq.top(); pq.pop(); second = pq.top(); pq.pop(); ans+=first+second; pq.push(first+second); } return ans; }
Rohit Bhai Please project ke upper ek video chahiye . pichle 1 saal se dsa kar raha hun but projects ka koi idea nahi hai. abhi 6th sem me hun.. bahut demotivate feel kar raha hun
1:10:11 Homework Question class Solution { public: long long pickGifts(vector& gifts, int k) { priority_queue pq; for(int i:gifts) pq.push(i); while(!pq.empty() && k--){ pq.push(floor(sqrt(pq.top()))); pq.pop(); } long long ans = 0; while(!pq.empty()){ ans += pq.top(); pq.pop(); } return ans; } };
QUESTION:1 MOST UNIQUE SOLUTION ALL OVER THE INTERNET class Solution{ public: int heapHeight(int N, int arr[]){ // code here int count=0; for(int i=1;i
This man from IIT GUWAHATI IS SHAPING OUR FUTURE ❤❤
Really helpful videos♥
1:21:48 Last tak
00:02 Understanding and solving heap related problems
02:23 Understanding the concept of heap height in detail
06:55 Understanding the height formula of the heap
09:07 Logic behind multiple divisions and height calculation
13:25 Finding minimum cost of connecting ropes
15:31 Finding the minimum cost of connecting ropes
22:03 Explaining the process of shifting elements in solving a problem
25:48 Shifting elements to maintain order in a heap
28:01 Understanding and using Min Heap in priority
31:58 Priority order for inserting and removing elements in a heap
33:49 Efficiently perform log operations and cost calculations
37:35 Optimizing insertion process using priority queue
39:16 Creating and using heaps to solve problems
43:21 Magician demonstrating a chocolate eating trick with a twist
45:20 Solving chocolate distribution problem with strategic approach
49:10 Implementing a heap and sorting the elements
51:02 Understanding time complexity of heap operations
54:48 Understanding the time complexity of heap operations
56:26 Implementing priority queue utilizing heap for maintaining a min heap structure.
1:00:11 Selecting the heaviest stones based on weight.
1:02:02 Collision of stones in a heap
1:05:48 Explanation of the process of removing elements from a heap
1:07:23 Returning the top element of a priority queue after certain operations.
1:11:26 Maximize profit by selecting and selling seats strategically
1:13:21 Select the maximum value and perform delete and insert operations simultaneously.
1:16:56 Understanding and implementing heap data structure
1:18:50 Implementation of a heap algorithm
Thanks
Last Stone Weight :
_________________________________________________
int lastStoneWeight(vector& stones) {
priority_queue q;
for (int i = 0; i < stones.size(); ++i) {
q.push(stones[i]);
}
int first = 0;
int second = 0;
while (q.size() > 1) {
first = q.top();
q.pop();
second = q.top();
q.pop();
int dif = abs(first - second);
if (dif > 0) {
q.push(dif);
}
}
return (q.size() > 0 ? q.top() : 0);
}
For students coming to see review of his videos
"I gotta tell you, It was perfect. Perfect. Everything, down to the last minute details.
Problem 6 :
___________________________________________________
int Solution::solve(vector &A, int B) {
priority_queue q;
for(int i = 0; i
Bro has some serious teaching skills wow well done rohit bhaiya
your DSA course is more comprehensive than others ❤❤
Really helpful videos
1:21:48 Last tak
Learning : every second important just go with the flow and embrace in mind and make notes and do revision
NO ONE CAN GIVE THIS LEVEL OF EXAPLATION🔥🔥
Bhaiya OP content and mind blowing explanation 😼
last tak dekh liya bhaiya bhot badiya lecture the 🙂🙂🙂
Bhaiya you have increased our level so much that now these easy questions doesn't excites me. Please do some hard level questions.
Jai shree Ram ❤️ ek dum OP content bhaiya what an explanation. :::))
Problem 5 :
____________________________________________
/* function parameter names have been changed for simplicity */
long long pickGifts(vector& B, int A) {
priority_queue q;
long long sum = 0;
for(int i = 0; i
❤
class Solution{
public:
int heapHeight(int N, int arr[]){
// code here
int height=-1;
for(int i=0; i
Seriously teaching no backwas Rohit bhaiya ki jay ho
Nice ❤❤ best series on heap concept chamka gaya
Thanks bhaiya ❤️🙏🏻
Another wonderful lecture bhaiya ❤❤
Thankyou bhaiya..
Priority queue✅🤙🏻
last stone weight came in my drive question but i did not know priority queue so I could not solve it. thank you bhaiya ❤❤.
Ab lag rha hga, ye toh bacho wala question th..
Superb lecture bhaiya 👍👍👍👍👍
Thnks Bhaiya Able To Solve 2 Question By Self 😀😀
Great Lecture as always !! 🔥🗿
Bhaiya maja aa gya array and heap wala concept sikh kar ke ki kb array ka use karna hai and kb heap ka 🔥🔥🔥🔥
last tak...alhamdulillah...may allah bless u
Problem 5:-
long long pickGifts(vector& gifts, int k) {
priority_queuep;
for(long long i = 0; i< gifts.size(); i++){
p.push(gifts[i]);
}
while(k--){
p.push(sqrt(p.top()));
p.pop();
}
long long ans = 0;
while(!p.empty()){
ans += p.top();
p.pop();
}
return ans;
}
static int heapHeight(int N,int[]arr){
return (int)(Math.log(N)/Math.log(2));
}
Good evening bhaiya ji. 💖
very nice explanation🥰🥰
superb lecture
Bhaiya you are really amazing .Thankyou so much
wonderful sir
1:21:58 Last tak ❤❤
1:21:53 Last Tak 🎉
Bhaiya Radhe Radhe 🙏
last tak
Amazing lec
RAdhe- RAdhe BHaiya Ji❤
nyc completed this
chamak chuka hh bhaiya ji😁
aap nahi hote to itne hajaro learners ka kya hota🥺🥺.....#lifeSaviour😇
Good night bhaiya ji
problem no : 1
______________________________________
long long minCost(long long arr[], long long n) {
// Your code here
priority_queue pq;
long long int ans = 0;
for(int i = 0; i 1) {
first = pq.top();
pq.pop();
second = pq.top();
pq.pop();
ans+=first+second;
pq.push(first+second);
}
return ans;
}
Rohit Bhai Please project ke upper ek video chahiye . pichle 1 saal se dsa kar raha hun but projects ka koi idea nahi hai. abhi 6th sem me hun.. bahut demotivate feel kar raha hun
@CoderArmy9 haan bhaiya please
LOved 2Days' class
last tak dekh ke smjh aa gya bhaiya kab heap ko use krna h
लास्ट तक 🎉
bhaiya mja aa gya
amazing.
Last tak ❤️
Day - 184 #180DaysOfCode
❤️✨🔥
Last Tak ❤❤❤❤
hacker or wott thanks bhai
❤
Last Tak 🎉 vo bhi bina skip kare
1:10:11 Homework Question
class Solution {
public:
long long pickGifts(vector& gifts, int k) {
priority_queue pq;
for(int i:gifts) pq.push(i);
while(!pq.empty() && k--){
pq.push(floor(sqrt(pq.top())));
pq.pop();
}
long long ans = 0;
while(!pq.empty()){
ans += pq.top();
pq.pop();
}
return ans;
}
};
last tak 🤟🤟
bhaiya JS ka badle full stack development jo bhi sahi rahe vo launch kardo aap🙏
🥰🥰
QUESTION:1 MOST UNIQUE SOLUTION ALL OVER THE INTERNET
class Solution{
public:
int heapHeight(int N, int arr[]){
// code here
int count=0;
for(int i=1;i
last tak ❤
last tak😎
Chamak gaya bhaiya
last tk chamak gya
last tak 🤩
Day 184 ✅🔥
Chamka++
thinking process ++++++
last tak 🤗🤗🤗🤗🤗🤗
Hi boss
last tak.....😁
Lasttak
I am think to try this course can plz some one tell me that does this course teach you all concept with in-depth knowledge
Bro aap first lecture dekh lo, aapko answer mil jaayega..
Thanks ❤
Last Tak
op op
lasttak
Last tak
heap++
antim tak
last tak kon kon tha
Bro is this is good or not
Should I do this or course of c++ by codehelp-by babbar
It is awesome ❤
Last tk:)
Bhaiya last tak
Last tak bro
last tak
Last tk
Brother ik TRIES topic in c pr bhi vdo needed h.@coderarmy
Tries, segment tree , fenwick Tree last mein cover hga, don't worry...
Last tak❤
Last tak
last tak
Last tk
Last tak❤
Last tak
last tak
Last tak
last tak
Last tak
last tak