Skip to content

Commit 607e36d

Browse files
committed
To reverse string using stack
1 parent 576faf8 commit 607e36d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

data_structures/stacks/reverse_string_using_stack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def push(self, item):
99
# this function pop will take out the top element from the stack
1010
def pop(self):
1111
return self.items.pop()
12-
# to check if the stack if empy without this we can't reverse the given string.
12+
# to check if the stack if empty without this we can't reverse the given string.
1313
def is_empty(self):
1414
return self.items == []
1515
# this function is optional it will just return to top of the stack when called
@@ -19,7 +19,7 @@ def peek(self):
1919

2020
def _reverse_(Stack, input_str_):
2121
# loop through the string then push it into the stack then
22-
# pop the item fro tne stack append to an empty string variable
22+
# pop the item from the stack append to an empty string variable
2323

2424
for i in range(len(input_str_)):
2525

0 commit comments

Comments
 (0)