Facing issue with code logic User Description: why my code giving this type of output in decreasing sort of interval of array.why 3,4 coming before 3,5
code link-https://ide.codingblocks.com/s/222136
Facing issue with code logic User Description: why my code giving this type of output in decreasing sort of interval of array.why 3,4 coming before 3,5
code link-https://ide.codingblocks.com/s/222136
its not any question just basic concept of sorting
why my code giving this type of output in decreasing sort of interval of array.why 3,4 coming before 3,5
@hunt
sorry for the late reply.
in ur code when u r defining the comparator, u r only considering the case of comparing pair.first . since u havent defined anything for pair.second it execute same as normal sort i.e if p1.second>p2.second, p1 will come first.
Hope dis will help.