@@ -19,9 +19,9 @@ The fact that it may contain the same element multiple times makes it different
1919
2020Generally, it has operations to…
2121
22- - … create an empty list ,
22+ - … create an empty stack ,
2323- … test for emptiness,
24- - … obtain the value of the element at "the top" of the stak ("peek"),
24+ - … obtain the value of the element at "the top" of the stack ("peek"),
2525- … add an element at "the top" of the stack ("push"),
2626- … remove an element at "the top" of the stack ("pop").
2727
@@ -30,15 +30,15 @@ Exactly like a stack of plates, stacks implement a "last in, first out" (LIFO) p
3030
3131### Difference with array
3232
33- Like lists, the ` Stack ` class serves a similar purpose than arrays, but with a few notable differences:
33+ Like lists, stacks serve a similar purpose to arrays, but with a few notable differences:
3434
3535- Stacks do not need to have a number of elements fixed ahead of time,
3636- Stacks automatically expand when elements are added,
3737- Stacks automatically shrink when elements are removed.
3838
3939### Difference with lists
4040
41- However, the ` Stack ` class is also different from lists:
41+ However, stacks have difference with lists:
4242
4343- Only the top element's value can be read (accessed),
4444- Adding and removing can only be done "on the right side", that is, at the top of the stack.
0 commit comments