Skip to content

Commit baaa38e

Browse files
committed
add description
1 parent e02b287 commit baaa38e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: Stacks/stack.java

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// Implemenmtation of stack data structure
2+
/*
3+
This implementation uses a generic type T to allow the stack to store elements of any type.
4+
The stack is implemented using an array and has methods for pushing, popping, peeking, checking
5+
if the stack is empty, and getting the size of the stack. The comments explain each step of the
6+
implementation.
7+
*/
18
public class Stack<T> {
29
// array to store elements of the stack
310
private T[] elements;

0 commit comments

Comments
 (0)