1月13日 操作系统 周六

操作系统
1月13日 周六
实现的功能: 快速排序 创建单链表
/* Note:Your choice is C IDE */

include “stdio.h”

//快速排序
int part(int a[],int low,int high)
{
int key;
//记录第一个下标的值
//以第一个下标为支点
key=a[low];
while(low

include “stdio.h”

//单链表5个节点
struct node
{
int data;
struct node *next;
};
void main()
{
struct node *head,*p,*s;
int e,i;

head=(struct node *)malloc(sizeof(struct node));
s=head;
//5
for(i=0;i<5;i++)
{
    printf("%d:",i+1);
    scanf("%d",&e);
    p=(struct node *)malloc(sizeof(struct node));
    p->data=e;
    p->next=NULL;
    s->next=p;
    s=p;
}
s=head;
for(i=0;i<5;i++)
{
    s=s->next;
    printf("%d",s->data);
}

}

Never put your happiness in someone else’s hands.
永远不要把自己的幸福放到别人的手中。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值