⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stack.c

📁 掌握如何用C来实现各种算法
💻 C
字号:
/*****************************************************************************
*                                                                            *
*  ------------------------------- stack.c --------------------------------  *
*                                                                            *
*****************************************************************************/

#include <stdlib.h>

#include "list.h"
#include "stack.h"

/*****************************************************************************
*                                                                            *
*  ------------------------------ stack_push ------------------------------  *
*                                                                            *
*****************************************************************************/

int stack_push(Stack *stack, const void *data) {

/*****************************************************************************
*                                                                            *
*  Push the data onto the stack.                                             *
*                                                                            *
*****************************************************************************/

return list_ins_next(stack, NULL, data);

}

/*****************************************************************************
*                                                                            *
*  ------------------------------ stack_pop -------------------------------  *
*                                                                            *
*****************************************************************************/

int stack_pop(Stack *stack, void **data) {

/*****************************************************************************
*                                                                            *
*  Pop the data off the stack.                                               *
*                                                                            *
*****************************************************************************/

return list_rem_next(stack, NULL, data);

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -