文章
4
粉丝
497
获赞
3
访问
35.5k
#include<bits/stdc++.h>
using namespace std;
struct node{
int num;
struct node *next;
};
struct node * create(){
struct node *head;
head = (struct node*)malloc(sizeof(node));
head->num = -1;
head->next = NULL;
return head;
}
void print(struct node* head){
for(struct node *p = head->next;p!=NULL;p = p->next)
cout<<p->num<<" ";
}
void sortlinklist(struct node *head){
for(struct node *pp = head->next;pp->next!=NULL;pp = pp->next){
for(struct node *pre = pp,*p = pre->next;p!=NULL;p = p->next){
if(pre->num>p->num){
int tmp = pre...
登录后发布评论
暂无评论,来抢沙发