Delete 'README.md'

This commit is contained in:
LuStar 2023-10-03 02:49:15 +08:00
parent 7db832af0d
commit d400082aba
1 changed files with 0 additions and 45 deletions

View File

@ -1,45 +0,0 @@
# 基于cortex-m3-emulator实现哈希表并测试验证
## 1. 简介
利用c语言实现了哈希表HashMap包括添加键值对(insert_hash_table),查找键对应的值(search_hash_table),清空哈希表(free_hash_table) 迭代遍历哈希表(show_hash_table)等功能、操作。
利用数组hashType作为存储空间利用链表(*next)解决冲突。
## 2. 数据结构设计说明
键值对结构;
```
typedef struct node {
int data;//存数据为方便运行key、value同值
struct node *next;//存指针,解决哈希冲突
}hashType;
```
包括以下函数功能,分别为:
`hashType **create_hash();`:创建一个哈希表
`int insert_hash_table(hashType **h, int data);`:添加键值对
`int show_hash_table(struct node *head);`:遍历哈希表
`void free_hash_table(struct node *head);`:清空哈希表
`int search_hash_table(hashType **h, int data);`:查找哈希表
## 3. 测试程序说明
测试了哈希表HashMap包括添加键值对(insert_hash_table),查找键对应的值(search_hash_table),清空哈希表(free_hash_table) 迭代遍历哈希表(show_hash_table)等操作。
并展示了利用链地址法解决哈希冲突的示例,遍历时,输出相同地址的链表中有多个节点。
## 4. 运行结果(需结合运行测试截图按步骤说明)
![image-20231003021711838](C:\Users\86183\AppData\Roaming\Typora\typora-user-images\image-20231003021711838.png)
打开menuconfig之后将test_hash_map开启(y),保存后退出
![image-20231003021810702](C:\Users\86183\AppData\Roaming\Typora\typora-user-images\image-20231003021810702.png)
编译XiZi-cortex-m3-emulator.elf成功
![image-20231003021900949](C:\Users\86183\AppData\Roaming\Typora\typora-user-images\image-20231003021900949.png)
启动qemu模拟Xiuos操作系统验证TestHash注册Shell命令
![image-20231003021918219](C:\Users\86183\AppData\Roaming\Typora\typora-user-images\image-20231003021918219.png)
![image-20231003021936160](C:\Users\86183\AppData\Roaming\Typora\typora-user-images\image-20231003021936160.png)
执行TestHash命令打印测试结果。