Guest User

Untitled

a guest
Sep 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. void container::Sort(ofstream &ofst){
  2.         bool flag;
  3.  
  4.         if(first == NULL){
  5.             return;
  6.         }
  7.  
  8.         ContainerNode *node = first;
  9.         ContainerNode *node2 = first;
  10.         ContainerNode *temp_node;
  11.        
  12.         do {
  13.             flag = false;
  14.             for(node = first;node = last;node = node->getNext()){
  15.                 node2 = node->getNext();
  16.                                 if ((node->getValue()->getCr()) > (node2->getValue()->getCr())) {// так сравнивать нельзя, смотри метод у string
  17.                                         switchNodes(node,node2); //метод меняющий местами
  18.                     flag = true;
  19.                                 }  
  20.             }
  21.         }while(flag != false);
  22.     }
Add Comment
Please, Sign In to add comment