Template Class StackWithLinkedList

Class Documentation

template<typename T>
class StackWithLinkedList

Stack with linked list class with all related functionality.

Template Parameters:

T – Type of the implementation class.

Public Functions

inline void push(const T &element)

Push an element onto the top of the stack.

Parameters:

element – The element to push.

inline T pop()

Pop the element at the top of the stack and return its value.

Returns:

Value of the popped element.

inline T peek() const

Get the value of the top element of the stack.

Returns:

The value of the top element of the stack.

inline size_t size() const

Get the size of the stack.

Returns:

Size of the stack.