From ac3e66b0a4c030c053e1771a1e36c3848ac19dc5 Mon Sep 17 00:00:00 2001 From: Koustav Chowdhury Date: Mon, 26 Nov 2018 07:26:34 +0530 Subject: [PATCH] An alternative approach + a correction (#23845) --- guide/english/cplusplus/stack/index.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/guide/english/cplusplus/stack/index.md b/guide/english/cplusplus/stack/index.md index e3cd0cac6e..8cf296be17 100644 --- a/guide/english/cplusplus/stack/index.md +++ b/guide/english/cplusplus/stack/index.md @@ -135,7 +135,10 @@ int main () #### Empty Returns whether the `stack` is empty ,i.e. whether your stack size is zero. -It returns `true` if stack's size 0 else returns `false` +It returns `true` if the size of the stack is 0 else returns `false`. An alternative to using this is +```cpp + if (stackname.size()==0) +``` ```cpp //Empty operation in Stack @@ -167,8 +170,7 @@ int main () ## Uses of Stack 1. Expression Evaluation and Conversion. - stacks are used to evaluate and convert expressions like prefx, postfix and infix expression. + Stacks are used to evaluate and convert expressions like prefix, postfix and infix expression. 2. In Recursive functions to keep information about the active functions or subroutines. 3. In Backtracking, as in DFS algorithm. 4. Memory management, run-time environment for nested language features. etc -