优先队列(下次总结完整)

来源:互联网 发布:闪电下单软件 编辑:程序博客网 时间:2024/06/03 03:43
  1. 1>>
  2. struct node  
  3. {  
  4.     int x,y,step;  
  5. }a,temp;  
  6. bool operator < (const node &x,const node &y)  
  7. {  
  8.     return x.step>y.step;  
  9. 2>>
    1. struct node  
    2. {  
    3.     int x;  
    4.     int y;  
    5.     int step;  
    6.     friend bool operator <(node a,node b)  
    7.     {  
    8.         return a.step>b.step;  
    9.     }  
    10. };  
    11. node a, temp;
    未完 下次补!

0 0
原创粉丝点击