Stack is a data structure that follows the property of **F**irst **I**n **L**ast **O**ut (**FILO**). So the first element inserted into a stack will be the last element deleted from the stack. You can think of a stack as a stack of dishes. The first dish that goes into the stack will be the last one to be used.

The problem is: Given **N** pairs of parentheses, write a function to generate all combinations of well-formed parentheses. The naive solution is to generate all combinations of **N** pairs of parentheses, then checking if each one is valid.

Graphs in computer science are different than what most people consider a graph to be. Graphs are a data type consisting of connected nodes (much like a linked list), only, with graphs, nodes have no limit to how many connections to other nodes they have.

Read More