STL Classes

This lesson provides you with the helper STL classes used throughout the course

We'll cover the following

Stack

Stacks are a type of data structure with last in first out (LIFO) order. A new element is added at the top and removed from that end only.

The functions supported by stacks are:

empty() – Returns whether the stack is empty or not.

size() – Returns the size of the stack.
 
top() – Returns a reference to the top most element of the stack.
 
push(i) – Insert an element 'i' at the top of the stack.
 
pop() – Deletes the top most element of the stack 

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.