the function will still work when called explicitly, from inside the function. so why do we need to pass it as a function .??
Passing function as parameter
@pradyumn25jain hey usually comparators ko hm dusre function me pass krte hai as argument kyunki hme ye chyy ki hmara function us comparator ke basis pr kam kre ,moreover agr ap alag se call kroge comparator ko to hmara time bdhega hi due to calling of functions.
but when we pass it as parameter we are still calling a function repeatedly , are we not ? is the time taken different for both.
@pradyumn25jain bhai ,ismen ek function dusre ki working pr depend krrha hai ,like sort function of stl takes comparator as third argument ,so ye inbuilt hi ek format hai so we have to follow apko alag se call nhi krna pad rha ,ek function ko hi call krrhe hai andr wala work krrha hai.
got it bro thank you so much
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.