Hi all,
I have got a list of class type that I need to do list.sort() on.
the class type is
Code:
class node_info{
public:
  node_number;
  node_gain;
}
And I have a list to store all these class types: list<node_info> node_list;
for example, initially the list of 3 elements would be like {{0,3},{1,2},{2,1}}

After the sort, i would like it to be like{{2,1},{1,2},{0,3}}
Could anyone tell me how to do this kind of trick? Would the time complexity be nlogn for this kind of sorting?

Thanks a lot