1、建立一个整形数的单链表,手动输入10个数,并从屏幕显示单链表元素列表。
2、从键盘输入一个数,查找在以上创建的单链表中是否存在该数;如果存在,显示它的位置;如果不存在,给出相应提示。
3、删除上述单链表中指定的元素。
*4、把单链表进行排序,使之成为一个有序的单链表。
#include <stdio.h>
#include <stdlib.h>
#include "LinkedList.h"
int main()
{
struct node *head;
int array[10];
int i,a,b;
printf("Please input 10 interger number:\n");
for(i=0;i<10;i++)
scanf("%d",&array[i]);
head=create();
for(i=0;i<10;i++)
insert(head,array[i]);
print(head);
printf("-----------------------------------------\n");
printf("Please input an interger number that you want to research:");
scanf("%d",&a);
research(head,a);
bubble_sort(head);
printf("Please input an interger number that you want to delete:");
scanf("%d",&b);
delete_(head,b);
print(head);
printf("-----------------------------------------\n");
reverse(head);
print(head);
}