数据结构 C语言版 第2版 李云清 杨庆红 揭安全 第02章_线性表(I).pptVIP

  • 23
  • 0
  • 约1.91万字
  • 约 95页
  • 2015-12-10 发布于广东
  • 举报

数据结构 C语言版 第2版 李云清 杨庆红 揭安全 第02章_线性表(I).ppt

第2章 线性表及其顺序存储 while (priority(stacktop(opst)) =priority(e[i])) f[j++]=pop(opst); push(opst,e[i]); /*当前元进栈*/ } i++; } /*处理下一元*/ while (!stackempty(opst)) f[j++]=pop(opst); f[j]=\0; } 判断是否为运算符 int is_operation(char op) { switch(op) { case +: case -: case ?: case /:return 1; default:return 0; } } 返回运算符的优先级 int priority(char op) { switch(op) {case (:return 0; case +: case -:return 1; case *: case /:return 2; default: return -1; } } 两个辅助函数: 本题源程序 后

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档