进栈
| 27 | |
| 28 | // 进栈 |
| 29 | bool Push(SqStack &S,ElemType x){ |
| 30 | if(S.top==MaxSize-1){ |
| 31 | // 栈满,返回false,元素无法进行进栈操作 |
| 32 | return false; |
| 33 | }else{ |
| 34 | // 可进栈,栈顶指针+1,再元素入栈 |
| 35 | S.data[++S.top]=x; |
| 36 | |
| 37 | // 入栈成功 |
| 38 | return true; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | |
| 43 | // 出栈 |
nothing calls this directly
no outgoing calls
no test coverage detected