-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIStack.cs
More file actions
47 lines (40 loc) · 1.17 KB
/
IStack.cs
File metadata and controls
47 lines (40 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
namespace Stack;
/// <summary>
/// A class representing the stack interface
/// </summary>
public interface IStack<T>
{
/// <summary>
/// Function for checking the stack for emptiness
/// </summary>
/// <returns> True - if the stack is empty </returns>
public bool IsEmpty();
/// <summary>
/// Function for adding an element to the stack
/// </summary>
/// <param name="value"> The value to add</param>
public void Push(T value);
/// <summary>
/// Function for removing an element from the stack
/// </summary>
/// <returns> Remote value</returns>
public T? Pop();
/// <summary>
/// Function that returns the number of elements in the stack
/// </summary>
/// <returns>Number of elements in stack</returns>
public int NumberOfElements();
/// <summary>
/// Function that returns the top of the stack
/// </summary>
/// <returns>Top of the stack</returns>
public T? TopOfTheStack();
/// <summary>
/// Function for stack printing
/// </summary>
public void PrintStack();
/// <summary>
/// Function for removing the stack
/// </summary>
public void ClearStack();
}