This program checks if two strings are permutation of each other are not. I have used concept of hashing to determine if they are permutation of each other in O(n) time.
In this program we used STL unordered_map
The most common and basic reprsentation of graphs are Adjacency List (using Linked List) and Adjacency matrix. But the question is that why to use C++ STL to implement graph when we can easily represent the graph using adjacency matrix (In which arrays are used) or Adjacency list (using Linked List).
In this question, a number which is represented by Linked List is given to you. You have to increment the number by 1 and the number must remain in the form of Linked List.
Selection sort is a sorting algorithm, specifically an in-place comparison sort. It sorts an array by finding the minimum element in every iteration. This algorithm finds the lowest element in the array and place it at first position in first iteration, second lowest element in second iteration and so on.
Insertion sort, This algorithm repeatedly adds new element to the sorted result. In this algorithm we take first element as the sorted sub-array. Then we take second element and puts it into the first sorted sub-array at its correct position (i.e we do shifting if necessary).
Doubly Linked List is a variation of Linked List in which traversal is possible in both directions, forward and backward. Doubly Linked List have two fields one is data field and other is link fields. Link fields itself contain two pointers, next and prev.
Prerequisite:- BFS algorithm must be known to check is the directed graph is strongly connected or not. If you don't know BFS (Breadth First Search) algorithm or implementation click the link given below.
Depth First Search (DFS) algorithm is used to traverse a graph depthward motion. DFS Algorithm use data structure stack to remember to get the next vertex to start the search and we will requred an array to keep the track of vertex that it is visited or unvisited.