From 1ac9bc5a15dff10655310245b97239f68fb34e5a Mon Sep 17 00:00:00 2001 From: mohamadAmin <39967064+Amin-mashari@users.noreply.github.com> Date: Wed, 11 Aug 2021 17:22:00 +0430 Subject: [PATCH 1/2] create Readme.md for stacks --- DataStructures/Stacks/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 DataStructures/Stacks/README.md diff --git a/DataStructures/Stacks/README.md b/DataStructures/Stacks/README.md new file mode 100644 index 000000000000..3ee7aba69070 --- /dev/null +++ b/DataStructures/Stacks/README.md @@ -0,0 +1,23 @@ +# STACK + +stack is an ADT (abstract data type ) that act like list of objects but there is a diffrents. + +stack act is * LIFO * (Last In First Out), it means that when we want to get an element from the stack we get the last element in the + +stack. + +stack is bast on two methods ( functions) + +## push & pop + +** push: ** add an alement to last index of stack. + +for example: we have `1, 3, 5` in stack, then we call push(9), + +`9` will add to last index of stack -> `1, 3, 5 , 9` + + +** pop: ** remove the last element from stack. +for example: we have `1, 3, 5 , 9` in stack, then we call pop(), + +the function will return `9` and the stack will change to `1, 3, 5`. From 4b7734f8a0a55e4ae43d60e677e56f6975fe525e Mon Sep 17 00:00:00 2001 From: Yang Libin Date: Mon, 23 Aug 2021 11:07:04 +0800 Subject: [PATCH 2/2] Update README.md --- DataStructures/Stacks/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/DataStructures/Stacks/README.md b/DataStructures/Stacks/README.md index 3ee7aba69070..9e3b95869211 100644 --- a/DataStructures/Stacks/README.md +++ b/DataStructures/Stacks/README.md @@ -2,22 +2,20 @@ stack is an ADT (abstract data type ) that act like list of objects but there is a diffrents. -stack act is * LIFO * (Last In First Out), it means that when we want to get an element from the stack we get the last element in the - -stack. +stack act is *LIFO* (Last In First Out), it means that when we want to get an element from the stack we get the last element in the stack. stack is bast on two methods ( functions) ## push & pop -** push: ** add an alement to last index of stack. +**push**: add an alement to last index of stack. for example: we have `1, 3, 5` in stack, then we call push(9), `9` will add to last index of stack -> `1, 3, 5 , 9` -** pop: ** remove the last element from stack. +**pop**: remove the last element from stack. for example: we have `1, 3, 5 , 9` in stack, then we call pop(), the function will return `9` and the stack will change to `1, 3, 5`.