Check if a graph is strongly connected or not
Given a directed graph, check if it is strongly connected or not. A directed graph is said to be strongly connected if every vertex is reachable from every other vertex.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a directed graph, check if it is strongly connected or not. A directed graph is said to be strongly connected if every vertex is reachable from every other vertex.
The transitive closure for a digraph G is a digraph Gā with an edge (i, j) corresponding to each directed path from i to j in G. The resultant digraph Gā representation in the form of the adjacency matrix is called the connectivity matrix.
The arrival time is the time at which the vertex was explored for the first time in the DFS, and departure time is the time at which we have explored all the neighbors of the vertex, and we are ready to backtrack.
Write a recursive program to efficiently reverse a given string in C, C++, and Java.
Write an iterative program to reverse a string in C++ and Java.
Write a recursive C/C++, Java, and Python program to calculate the factorial of a given positive number.
Write a recursive program to find all factorial numbers less than or equal to n. The factorial n! of a non-negative integer n is the product of all positive integers less than or equal to n.
Write an iterative C/C++ and java program to find factorial of a given positive number.
Write an iterative program to print factorial series in a given range efficiently. The factorial n! of a non-negative integer n is the product of all positive integers less than or equal to n.
Write a program to determine if a given number is a palindrome or not. A palindromic number is a number that remains the same when its digits are reversed.
Given two numbers, calculate the maximum number without using a conditional statement or ternary operator.
Given two integers, swap them in a single line in Java.