Comparator Function | Custom Priority Queues | Sort in STL | Competitive Programming |

preview_player
Показать описание
Hello Guys , this is a tutorial video which contains explanation of Comparator Function ,Priority Queues ,and where Comparator Function are used.
---------------------------------------------------------------------------------------------------------------------------
If you want other tutorial video on any other topic which you find difficult to understand tell me in comment section.

If you like this video then like it and share it. If you are new on this channel subscribe this channel for further videos.
----------------------------------------SHUBH CODING-------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

Underrated Video!!
This video deserves more attention. You explained the comparators very clearly.(2)
Love from BD

shawon.SEC
Автор

Summary = > With sort function we pass the function name/functors and with associative data types like set, map, priority_queue we have to pass the class name and in that class we need to overload the " ( ) " function call operator whose arguments will be passed by reference. One common thing between both is that, in the arguments the first variable in definition will be the element of the smaller index and second will be the element of larger index. In priority queue internally it sorts the input data such that the element with the largest priority comes at the end and hence when we use max heap(default implementation) the container internally will sort the elements in the ascending order and when we want to implement the min heap we need to arrange the elements inside container in the descending order using class definition and operator overloading withing it.

trojanhorse
Автор

This video deserves more attention. You explained the comparators very clearly.

thepriestofvaranasi
Автор

I was really struggling in understand how the comparator worked in case of priority queue, I was constantly thinking that for MIN Heap I should return ``` a < b ``` in the comparator, until I saw this video that in priority queue highest priority was given to the last element...
Thank You so much, and I really admire the clarity of concepts you have and the how you are able to convey it as well.

aayushgupta
Автор

Finally understood comparators!! Thanks a lot!❤

Rahul-kwzf
Автор

Thanks Brother. Your explanation was clear and I have understood everything u explained .

M_Sarwar_Tanbeen
Автор

sir aapka hath jorkr sukriya ada kar rha hun, aapki wajah se aaaj maine apna dukh dard dur ho gya i m feeling so good, heaps ek question hai merge k sorted array isme ye priority queue ka concept use hua hai is wajah se mujhe samjh hi nhi aa rha tha but now i m feeling so confident . dil ki gehraiyon se apka sukriya 🙃🙃😊😊

ankit_yadav
Автор

very good video for priority queue and comparator, thnks for your efforts

pranavsharma
Автор

This is the only video which can tell comparators of priority queue is a really nice way with full concept.Thanks for that

focusman
Автор

Best Explanation till now!! Best pedagogical style i have ever seen!!!

akshitsangwan_
Автор

best explanation on comparator functions hands down

AkshatChaudhary-fevv
Автор

Awesome explanation cleared all my doubts.

satyajeetkumar
Автор

Literally You explained it very well, , , I have gone through multiple videos for sorting but no one gave clear view on now I am full confident on sort compare function

threadRunnable
Автор

ultra useful video, , .comparators are used very frequently

fahadabdullah
Автор

Thank you Sir ! Ek number samjhaya aapne !

harendrakumar
Автор

A great explanation, before watching this video .. this particular topic was always confusing...

sunny
Автор

Your teaching style is very good... i can easily understand... please make a good playlist of dp for begginner to advance...

Rakib.
Автор

I really couldn't get why my comparators in priority queues were not working as intended, now i get it. Thanks

anishsinha
Автор

U explained the comparator functions in a very easy and efficient way, thanks bhaiya

pritishpattnaik
Автор

Wahh ky flow m smjhate ho mja aa gya.. keep it up 👏

siddharth.chandani
visit shbcf.ru