Introduction to algorithms / Thomas H. Cormen...[etal.].—3rded.

If we attempt to pop an empty stack, we say the stack underflows, which is normally an error.If S.top exceeds n, the stack overflows.
 
STACK-EMPTY(S)
if S.top ==
return TRUE
else return FALSE PUSH(S, x)
S.top = S.top +
S[S.top] = x POP(S)
if STACK-EMPTY(S)
error 'underflow'
else S.top = S.top -
return S[S.top + ]
//we can implement  a stack of at mostnelements withan arraySŒ1::n.
DIY-FULL(S)
if S.top < n
return FLASE
else return TRUE DIY-POP(S)
if STACK-EMPTY(S)
error 'underflow'
else if DIY-FULL(S)
error 'overflow'
else S.top = S.top -
return S[S.top + ]

最新文章

  1. SQL多表连接查询(详细实例)
  2. metasploit用法
  3. 在phpwind内容页使用百度分享进行图片分享
  4. 桥牌笔记:Skill Level 4 D8
  5. php imagecreatetruecolor输出字符符或验证码
  6. 李洪强iOS开发之OC[015]#pragma mark的使用
  7. CSS实现背景透明而背景上的文字不透明完美解决
  8. 基于visual Studio2013解决C语言竞赛题之0810链表去重
  9. Express 简介
  10. spring注解大全
  11. 基于Nginx服务器和iOS9的HTTPS安全通信
  12. 使用Docker部署Spring boot项目
  13. python安装多版本
  14. static易错点
  15. ubuntu安装GBK编码
  16. Iterator,迭代器模式,C++描述
  17. ASP.NET Core 1.0 基础与应用启动
  18. C#Redis初识
  19. Postman-断言和Runner
  20. ajax 二级联动与springmvc 交互

热门文章

  1. PostgreSQL恢复误删数据
  2. 利用shell脚本自动获取awr报表
  3. 十款不错的Hybrid App移动开发框架
  4. Android开发懒人库 -- ButterKnife (转载)
  5. Web负载均衡与分布式架构
  6. MDU某产品OMCI模块代码质量现状分析
  7. Git学习之Git恢复进度
  8. 【分享】Linux(Ubuntu)下如何自己编译JDK
  9. CF 445A DZY Loves Chessboard
  10. Struts2之Action三种接收参数形式与简单的表单验证