Files
HW_Lib/lib/inc/list/array.h
JiXieShi ef79633f1a UP
2024-06-21 13:25:01 +08:00

33 lines
753 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef HW_LIB_ARRAY_H
#define HW_LIB_ARRAY_H
#ifdef __cplusplus
extern "C" {
#endif
// 在数组的索引 index 处插入元素 num
// nums: 操作数组
// size: 数组大小
// num: 操作数
// index: 操作位置
void insert(int *nums, int size, int num, int index);
// 删除索引 index 处的元素
// nums: 操作数组
// size: 数组大小
// index: 索引位置
// 注意stdio.h 占用了 remove 关键词
void removeItem(int *nums, int size, int index);
// 在数组中查找指定元素
// nums: 操作数组
// size: 数组大小
// target: 查找元素
int find(int *nums, int size, int target);
/* 扩展数组长度 */
int *extend(int *nums, int size, int enlarge);
#ifdef __cplusplus
}
#endif
#endif //HW_LIB_ARRAY_H