Problem Statement: Given a weighted graph, find the shortest path between any two vertices of a graph. Code: Adjacency Matrix […]
Problem Statement: TCS is working on a new project called “Testvita“. There are N modules in the project. Each module […]
Problem Statement: Given an undirected Graph, write an algorithm that returns True if the graph contains a cycle, otherwise False. […]
There is a new alien language that uses the English alphabet. However, the order among the letters is unknown to […]
Problem Statement: There are a total of numCourses courses you have to take, labeled from 0 to numCourses – 1. You are given an array prerequisites where prerequisites[i] […]
Problem Statment: Topological Sort of a directed graph (a graph with unidirectional edges) is a linear ordering of its vertices such […]
Problem Statement: You are given an array routes representing bus routes where routes[i] is a bus route that the ith bus repeats forever. For example, if routes[0] […]
Problem Statement: You are given an n x n integer matrix board where the cells are labeled from 1 to n2 in a Boustrophedon style starting from the bottom left […]
CODE Output: Adjacency List of Undirected Graph Delhi => Mumbai Bangalore Mumbai => Delhi Hyderabad Bangalore Bangalore => Delhi Mumbai […]
Java Code Output: Adjacency List of Undirected Graph 0 => 1 2 1 => 0 3 2 => 0 3 […]