mirror of
https://github.com/huihut/interview.git
synced 2025-12-18 13:04:38 +03:00
添加了顺序栈、队列、顺序表
This commit is contained in:
77
README.md
77
README.md
@@ -39,6 +39,77 @@
|
|||||||
|
|
||||||
## 数据结构
|
## 数据结构
|
||||||
|
|
||||||
|
### 顺序结构
|
||||||
|
|
||||||
|
#### 顺序栈(Sequence Stack)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
typedef struct {
|
||||||
|
ElemType *elem;
|
||||||
|
int top;
|
||||||
|
int size;
|
||||||
|
int increment;
|
||||||
|
} SqSrack;
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### 队列(Sequence Queue)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
typedef struct {
|
||||||
|
ElemType * elem;
|
||||||
|
int front;
|
||||||
|
int rear;
|
||||||
|
int maxSize;
|
||||||
|
}SqQueue;
|
||||||
|
```
|
||||||
|
|
||||||
|
##### 非循环队列
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
`SqQueue.rear++`
|
||||||
|
|
||||||
|
##### 循环队列
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
`SqQueue.rear = (SqQueue.rear + 1) % SqQueue.maxSize`
|
||||||
|
|
||||||
|
#### 顺序表(Sequence List)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
typedef struct {
|
||||||
|
ElemType *elem;
|
||||||
|
int length;
|
||||||
|
int size;
|
||||||
|
int increment;
|
||||||
|
} SqList;
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 链式结构
|
||||||
|
|
||||||
|
#### 链栈(Link Stack)
|
||||||
|
|
||||||
|
#### 链队列(Link Queue)
|
||||||
|
|
||||||
|
#### 线性表的链式表示(Link List)
|
||||||
|
|
||||||
|
### 哈希表
|
||||||
|
|
||||||
|
### 递归
|
||||||
|
|
||||||
|
### 二叉树
|
||||||
|
|
||||||
|
### 三叉树
|
||||||
|
|
||||||
|
### 森林
|
||||||
|
|
||||||
|
### 图
|
||||||
|
|
||||||
## 算法
|
## 算法
|
||||||
|
|
||||||
### 排序
|
### 排序
|
||||||
@@ -229,7 +300,7 @@ Add | 0x123
|
|||||||
|
|
||||||
extern "C" 的作用是让C++编译器将 `extern "C"` 声明的代码当作C语言代码处理,可以避免C++因符号修饰导致代码不能和C语言库中的符号进行链接的问题。
|
extern "C" 的作用是让C++编译器将 `extern "C"` 声明的代码当作C语言代码处理,可以避免C++因符号修饰导致代码不能和C语言库中的符号进行链接的问题。
|
||||||
|
|
||||||
```
|
```cpp
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -274,7 +345,7 @@ Linux下的共享库就是普通的ELF共享对象。
|
|||||||
### Windows的动态链接库(Dynamic-Link Library)
|
### Windows的动态链接库(Dynamic-Link Library)
|
||||||
|
|
||||||
DLL头文件
|
DLL头文件
|
||||||
```
|
```cpp
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -297,7 +368,7 @@ MODULE_API int module_init();
|
|||||||
```
|
```
|
||||||
|
|
||||||
DLL源文件
|
DLL源文件
|
||||||
```
|
```cpp
|
||||||
#define MODULE_API_EXPORTS
|
#define MODULE_API_EXPORTS
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
|
|
||||||
|
|||||||
BIN
images/SqList.png
Normal file
BIN
images/SqList.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
images/SqLoopStack.png
Normal file
BIN
images/SqLoopStack.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
images/SqQueue.png
Normal file
BIN
images/SqQueue.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
images/SqStack.png
Normal file
BIN
images/SqStack.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user