制作一个图书管理系统,使用c语言链表,要求能做到: (1)根据指定图书个数,逐个输入图书信息(包括,图书编号,ISBN,书名,价格,出版社); (2)逐个显示中所有图书关信息; (3)给定一个图书,插入到表中指定的位置; (4)删除指定位置的图书; (5)统计表中图书数量 (6)利用快速排序按照ISBN; (7)分别利用直接插入排序和折半插入排序按照ISBN; (8)根据ISBN进行折半查找,返回此书的书名和作者。
时间: 2024-01-21 14:02:28 浏览: 82
好的,我会尽力回答你的问题。首先,你需要定义一个图书结构体,包含图书编号、ISBN、书名、价格和出版社等信息。然后,你需要使用链表来存储这些图书信息。
以下是一个简单的图书结构体的定义:
```c
struct book {
int book_id;
char isbn[20];
char title[100];
float price;
char publisher[100];
struct book *next;
};
```
接下来,你需要实现一些函数来操作这个链表。下面是一个函数列表:
1. `struct book* create_book_list(int n)`:创建一个包含n个图书的链表。
2. `void display_book_list(struct book *head)`:显示链表中所有图书的信息。
3. `void insert_book(struct book *head, struct book *new_book, int position)`:在链表的指定位置插入一个新的图书。
4. `void delete_book(struct book *head, int position)`:删除链表中指定位置的图书。
5. `int count_books(struct book *head)`:统计链表中图书的数量。
6. `struct book* quick_sort_by_isbn(struct book *head)`:使用快速排序按照ISBN排序链表。
7. `struct book* insertion_sort_by_isbn(struct book *head)`:使用直接插入排序按照ISBN排序链表。
8. `struct book* binary_insertion_sort_by_isbn(struct book *head)`:使用折半插入排序按照ISBN排序链表。
9. `struct book* binary_search_by_isbn(struct book *head, char *isbn)`:使用折半查找根据ISBN查找指定图书的信息。
这些函数的实现细节可以根据你的具体需求来进行调整和修改。
阅读全文
相关推荐


















