Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct DoubleList
- {
- double data;
- char* name;
- DoubleList *next;
- DoubleList *prev;
- };
- DoubleList *head;
- ///////////////////////////////////
- void Sort()
- {
- char *h = new char[128];
- DoubleList * list = head;
- for(int n=0;n<=100;n++)
- {DoubleList * node=list, * node2=list;
- node2=node2->next;
- do
- {
- if( node->data > node2->data ){
- double i = node->data;h=node->name;
- node->data = node2->data;node->name = node2->name;
- node2->data = i;node2->name = h;
- }
- node=node->next;
- node2=node2->next;
- } while(node2!=head);}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement