This commit is contained in:
krahets
2023-04-22 01:35:51 +08:00
parent 263c979237
commit 881ece517f
9 changed files with 87 additions and 67 deletions

View File

@@ -1043,6 +1043,8 @@ comments: true
struct doublyListNode *prev; // 前驱节点
};
typedef struct doublyListNode doublyListNode;
/* 构造函数 */
doublyListNode *newDoublyListNode(int num) {
doublyListNode *new = (doublyListNode *)malloc(sizeof(doublyListNode));
@@ -1063,6 +1065,8 @@ comments: true
int queSize; // 双向队列的长度
};
typedef struct linkedListDeque linkedListDeque;
/* 构造j */
linkedListDeque *newLinkedListDeque() {
linkedListDeque *deque = (linkedListDeque *)malloc(sizeof(linkedListDeque));
@@ -2166,6 +2170,8 @@ comments: true
int queCapacity; // 队列容量
};
typedef struct arrayDeque arrayDeque;
/* 构造函数 */
arrayDeque *newArrayDeque(int capacity) {
arrayDeque *deque = (arrayDeque *)malloc(sizeof(arrayDeque));

View File

@@ -685,6 +685,8 @@ comments: true
int queSize;
};
typedef struct linkedListQueue linkedListQueue;
/* 构造函数 */
linkedListQueue *newLinkedListQueue() {
linkedListQueue *queue = (linkedListQueue *)malloc(sizeof(linkedListQueue));
@@ -1459,6 +1461,8 @@ comments: true
int queCapacity; // 队列容量
};
typedef struct arrayQueue arrayQueue;
/* 构造函数 */
arrayQueue *newArrayQueue(int capacity) {
arrayQueue *queue = (arrayQueue *)malloc(sizeof(arrayQueue));

View File

@@ -636,6 +636,8 @@ comments: true
int size; // 栈的长度
};
typedef struct linkedListStack linkedListStack;
/* 构造函数 */
linkedListStack *newLinkedListStack() {
linkedListStack *s = malloc(sizeof(linkedListStack));
@@ -1204,6 +1206,8 @@ comments: true
int size;
};
typedef struct arrayStack arrayStack;
/* 构造函数 */
arrayStack *newArrayStack() {
arrayStack *s = malloc(sizeof(arrayStack));