📄 lud_stack.h
字号:
#pragma once
#include "LUD_Utils.h"
/* CONVENTIONS: All data structures for stacks have the prefix */
/* "stk_" to prevent name conflicts. */
/* */
/* Function names: Each word in a function name begins with */
/* a capital letter. An example funcntion name is */
/* CreateRedTree(a,b,c). Furthermore, each function name */
/* should begin with a capital letter to easily distinguish */
/* them from variables. */
/* */
/* Variable names: Each word in a variable name begins with */
/* a capital letter EXCEPT the first letter of the variable */
/* name. For example, int newLongInt. Global variables have */
/* names beginning with "g". An example of a global */
/* variable name is gNewtonsConstant. */
/* if DATA_TYPE is undefined then stack.h and stack.c will be code for */
/* stacks of void *, if they are defined then they will be stacks of the */
/* appropriate data_type */
#ifndef DATA_TYPE
#define DATA_TYPE void *
#endif
typedef struct stk_stack_node {
DATA_TYPE info;
struct stk_stack_node * next;
} stk_stack_node;
typedef struct stk_stack {
stk_stack_node * top;
stk_stack_node * tail;
} stk_stack ;
/* These functions are all very straightforward and self-commenting so */
/* I didn't think additional comments would be useful */
stk_stack * StackJoin(stk_stack * stack1, stk_stack * stack2);
stk_stack * StackCreate();
void StackPush(stk_stack * theStack, DATA_TYPE newInfoPointer);
void * StackPop(stk_stack * theStack);
int StackNotEmpty(stk_stack *);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -