Find the 'Kth' max and min element of an array | Q3 | Love Babbar DSA Sheet

preview_player
Показать описание
#coding #competitiveprogramming #interviewquestions #dsaseries

In this video I have explained the 3rd problem in the sheet with 2 approaches and the link of the other approach is given below.

Hope you like it. If have any doubt then just comment down below.

LIKE | SHARE | SUBSCRIBE
Рекомендации по теме
Комментарии
Автор

thank you. it was so simple.
all the solutions from other websites looked so complex for beginners and were kind of discouraging.

nehalpradhan
Автор

I am comfertable with English 🤩.
Love your videos😇♥️

funky_manyt
Автор

sir expected time complexity is O(n) and you are solving this problem in O(nlogn) time sir i am come here in your video to see the solution in O(n) so my request is that please make a video that the solution takes order of n time

tusharchamp
Автор

Bro, Can u please do a video in partition approach as well? Also english is fine.

nivedithaniveditha
Автор

the time complexity for the second approach in pushing the elments into heap is nlogn ...isnt it????

oqant
Автор

Can u please explain a little more on how the complexity is n+klogn for approach-2 . I think the pushing into priority queue will give us nlogn+ k times pop is klogn hence complexity is nlogn+klogn.plz let me know where I'm going wrong

shreyasingh
Автор

Liked the explaination! Can you please also make a video, in which you show how you have set up your CodeEditoe. It will be a great help

royharper
Автор

Continue in English bro...and thanks for your efforts 🤩😀🥰

SM-ehvz
Автор

how to transfer to gfg from sublime text
(1st approach)

AtulKumar-eonx
Автор

please explain it in java also as many of the viewers are doing code in java

ShivamKumar-ercu
Автор

Good morning sir, sir will you kindly explain me the logic:
int ans, i=1;
while(!p.empty()){
if(i==k){
ans = p.top();
break;
}
i++;
p.pop();
}
this is for Kth element in matrix question.

prateekbajpai
Автор

please make use of vectors instead of arrays

ashwinvarma
Автор

can you explanin why using the mean heap takes N+Klog(N). I am presuming N for bulding the heap and Log(n) for calling minelement K times.

ryan-boxi
Автор

As you link provided in the description geeksforgeeks is claim that it worst case time complexity is O(N), but you told that in this video it will take O(N) in best case and O(N^2 ) in worst case. i am just confused?? if you get it please tell how to select pivot randomly while doing so...

ajitkumaryadav
Автор

Bro n+klogn so we consider it o(n), because we ignore klogn

chanduchandrakanth
Автор

Before coding please explain the concept.

yashsoni-mfcd
Автор

the approach is good but its showing time limit exceeded please make a video on more optimized approach

vinayakrastogi
Автор

explain the time complexity please
it should be O(n+log(n)) right?

Creating a heap takes O(n) time while inserting into a heap (or priority queue) takes O(log(n)) time.

rohandevaki
Автор

yes we want in English there are lot of other videos for dsa babbar in HINDI.

deekshithpranav
Автор

Brother, your are doing well. Can you make some videos for beginners? I am a freshers of your college.

rwiteshbera