能讲解两段代码实现操作和时空复杂度上的区别吗?
struct node{
int x,y,val;
};
struct cmp{
bool operator()(const node &a,const node &b){
return a.val<b.val;
}
};
struct node{
int x,y,val;
}edge[1005];
bool cmp(node a,node b){
return a.val<b.val;
}
int main(){
sort(edge+1,egde+m+1,cmp);
}
noip在即,想问问学这个用处大不大