Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. struct DoubleList
  2. {
  3. double data;
  4. char* name;
  5. DoubleList *next;
  6. DoubleList *prev;
  7. };
  8. DoubleList *head;
  9. ///////////////////////////////////
  10. void Sort()
  11. {
  12. char *h = new char[128];
  13. DoubleList * list = head;
  14. for(int n=0;n<=100;n++)
  15. {DoubleList * node=list, * node2=list;
  16. node2=node2->next;
  17. do
  18. {
  19. if( node->data > node2->data ){
  20. double i = node->data;h=node->name;
  21. node->data = node2->data;node->name = node2->name;
  22. node2->data = i;node2->name = h;
  23. }
  24. node=node->next;
  25. node2=node2->next;
  26. } while(node2!=head);}
  27.  
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement