## C++ Program to check if two strings are permutation of each other in O(n) Time

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.

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

- Read more about C Program to Multiply two Matrices
- Log in or register to post comments

C Program to multiply two matrices is given below. In the program **m1, n1** are denoting the number of rows and columns of the matrix 1 & **m2,n2** denoting number of rows and columns respectively for the second matrix. Program is successful executed and sample output is also attached.

**Algorithm:**

- Read more about Graph Implementation using C++ STL
- Log in or register to post comments

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.

- Read more about C Program for Implementation of Selection Sort
- Log in or register to post comments

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.

A directed graph is said to be strongly connected when it is possible to visit every node of the graph from any node. Here we are discussing simple approach to check if a directed graph is strongly connected nor not.

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.