comparator function.use of stl how stl works and all
Comparator function
i have a doubt i cant explain by typing . pls send the google meet link.
hello @sr7.shubhamrai
sry can take it on meet.
u can write here only. in hindi or english(in whatevre language u r comfortable) .
bhaiyaa how does our bool function is passed to the sort function that is already included in the stl lib.
like we pass any variables to any function during function call, in the same way u can pass any function in the function call .
in sort function.
the third argument is reserved for comparator function .
if u want to order data with ur own logic then u need to write ur own comparator and pass its name as third argument.
now if u dont pass any function then there are compartor already defined in the library one is less than comparator (for sorting in ascending order)
and one is greater than comparator (for sorting in descending order).
compiler use less than comparator as it default comparator for sorting.
u didnt get my doubt bhaiyaa cam i call u???
i think no one is there on the call
i had resined but im back
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.