Here we are not gonna discuss the definitions of graph and its algorithm we are just going to visualise what graph is and different ways to store the graph.
It is totally different from the one we see in mathematics. Basically it is a way to represent the relations between a set of entities. This set of entities are called nodes and the relation between any two entities are called edge.
Let us see an example to get the actual visualization of graph. Everyone uses Facebook. …
Here we are going to discuss about some STLs that are frequently used in competitive programming. Like string, vector, pair, queue, stack, set and map.
STL (Standard Template Library): STL provides a set of common classes for C++, such as containers ( Queue , Stack ) and associative arrays ( Hash tables ) , that can be used with any built-in data-type and with any user-defined data-type that supports some elementary operations (such as copying and assignment).
All STLs provide dynamic memory allocation. Vector and string have contiguous memory allocation and the rest have non-contiguous memory allocation.
So now we should see each STL one by…