here the bool data type is return by the comparator but what is item1 before item 2 ?
Question 4 what datatype should return
@Vikaspal,
In q4, bool and 1, is the answer because return type of comp function is bool and for ascending values, item 1 should be less than item 2, (assuming that item1 occurs before item2) this is why item1 < item2 returns true.
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.