新手求助!三个题,求大神帮忙
编写下列函数
链表实验题目。链表结点的结构定义为。:struct node{int value; struct node*next;}
struct node *add_to_list(struct node *head, int n) //向链表首部插入一个值为n的结点
struct node *build_list() //建立链表,调用函数struct node *add_to_list(struct node *head, int n)
struct node *search_list(struct node *head, int n) //搜索链表
struct node *delete_from_list(struct node *head, int n) //删除链表中值为n的结点,并释放该结点
void print_list(struct node *head) //打印链表
有序链表
编写下列函数:
struct node *insert(struct node *head, int n) //向链表首部插入一个值为n的结点,使链表的结点值从小到大有序
struct node *build_list() //建立链表,调用函数struct node *insert(struct node *head, int n)
struct node *search_list(struct node *head, int n) //搜索链表
struct node *delete_from_list(struct node *head, int n) //删除链表中值为n的结点,并释放该结点
void print_list(struct node *head) //打印链表
编写下列函数(指向指针的指针
编写下列函数:
void add_to_list(struct node **head, int n); //向链表首部插入一个值为n的结点
struct node *build_list(); //建立链表,调用函数add_to_list(struct node **head, int n)
struct node *search_list(struct node *head, int n); //搜索链表
void delete_from_list(struct node **head, int n); //删除链表中值为n的结点,并释放该结点
void print_list(struct node *head); //打印链表