Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void container::Sort(ofstream &ofst){
- bool flag;
- if(first == NULL){
- return;
- }
- ContainerNode *node = first;
- ContainerNode *node2 = first;
- ContainerNode *temp_node;
- do {
- flag = false;
- for(node = first;node = last;node = node->getNext()){
- node2 = node->getNext();
- if ((node->getValue()->getCr()) > (node2->getValue()->getCr())) {// так сравнивать нельзя, смотри метод у string
- switchNodes(node,node2); //метод меняющий местами
- flag = true;
- }
- }
- }while(flag != false);
- }
Add Comment
Please, Sign In to add comment