ProDeveloperTutorialonAugust 29, 2026 Graph: Given a graph, check if it is bipartite or not – Using BSF Problem Statement: You are given a graph with the number of vertices and list of edges. You need to check if the graph is bipartite or not. A…
ProDeveloperTutorialonAugust 29, 2026 Graph: Given course with prerequisites, find the order of taking the courses Problem Statement: You are given n courses, labeled from 0 to n-1 and prerequisites[][]. prerequisites[i] = [x, y], meaning you should take…
ProDeveloperTutorialonAugust 29, 2026 Graph: Check if the given courses can be completed with prerequisites Problem Statement: You are given n courses, labeled from 0 to n-1 and prerequisites[][]. prerequisites[i] = [x, y], meaning you should take…
ProDeveloperTutorialonAugust 29, 2026 Graph: Find the number of Islands Problem Statement: You are given a n * m matrix, where ‘w’ is water and ‘l’ is land. You need to count the number of…
ProDeveloperTutorialonAugust 29, 2026 Graph: DFS graph traversal Graph: DFS graph traversal DFS stands for Depth First Search. In this we will traverse adjacent vertices one by one. This is similar to…
ProDeveloperTutorialonAugust 29, 2026 Binary Search Trees: Given a BST, find the second largest element in the BST Problem Statement: Given a BST, find the second largest element in the BST Example Input: /* * 10 * / \ * 8 12 * / \ / \ * 2 9 11 14 */…
ProDeveloperTutorialonAugust 29, 2026 Binary Search Trees: Given a sorted array, convert into balanced bst Problem Statement: Given a sorted array, convert into balanced bst Example: Input: arr = [1, 2, 3] Output: /* * 2 * / \ * 1 3 */ Solution…
ProDeveloperTutorialonAugust 29, 2026 Binary Search Trees: Given a BST and a key, search in a BST Problem Statement: Given a BST and a key, search in a BST Example: Input: /* * 10 * / \ * 8 12 * / \ / \ * 2 9 11 14 */ key = 12 Output: True…
ProDeveloperTutorialonAugust 29, 2026 Binary Search Trees: Given a BST, remove all the leaf nodes Problem Statement: Given a BST, remove all the leaf nodes Example: Input: /* * 10 * / \ * 8 12 * / \ / \ * 2 9 11 14 */ Output: /* * 10 * / \…
ProDeveloperTutorialonAugust 29, 2026 Binary Search Trees: Given 2 BST, check if both contain same set of elements Problem Statement: Given 2 BST, check if both contain same set of elements Example: Input: /* * 10 * / \ * 8 12 * / \ / \ * 2 9 11 14 */ /* *…