Graphs

Categories: Code Problem / Data Structures and Algorithms / Recursion (32) Code Problem / Data Structures and Algorithms / Binary Search (30) Code Problem / Data Structures and Algorithms / Linked Lists (26) Code Problem / Data Structures and Algorithms / Backtracking (26) Code Problem / Data Structures and Algorithms / Stacks and Queues (25) Code Problem / Data Structures and Algorithms / Hashing (24) Databases / SQL / Backup and Recovery (19) Code Problem / Data Structures and Algorithms / Arrays and Strings (19) Databases / SQL / Database Normalization (18) Code Problem / Data Structures and Algorithms / Time Complexity (17) Databases / SQL / Locking (16) Databases / SQL / Replication (15) Databases / SQL / SQL Queries (13) Code Problem / Data Structures and Algorithms / Graphs (13) Databases / SQL / Database Security (13)  More...

Recent solutions:

Check these solutions from our community:
Code Problem / Data Structures and Algorithms DifficultyMedium C++
This technical problem deals with finding a route between two nodes in a directed graph. An algorithm is designed to determine whether there is a path between the two nodes.
About this solution: The candidate's solution is complete and solves the problem. The approach is to use a queue to keep track of the nodes that have been visited. If the end node is found in the neighbors of the current node, then there is a route between the two nodes.
Nov 26
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This problem is about finding a route between two nodes in a directed graph. An example input and output is given.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate has correctly implemented a breadth-first search algorithm to find a route between two nodes in a graph. The candidate's approach is sound.
Nov 24
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This problem deals with finding a route between two nodes in a directed graph. An example input is given, along with the expected output.
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The approach is not clear.
Nov 19
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem deals with finding a route between two nodes in a directed graph. An example input is given, and the expected output is "There is a route between A and D."
About this solution: The candidate's solution is correct and uses a breadth-first search to find the shortest path between two nodes. The time complexity is O(n) and the space complexity is O(n).
Nov 18
Code Problem / Data Structures and Algorithms Python
Given a 2D array of integers, this problem looks for the longest path from the top left to the bottom right where each step only visits cells with values greater than or equal to the current cell.
About this solution: The candidate's solution is complete and solves the problem. The approach is to use dynamic programming. The idea is to create a 2D array of the same size as the input array. The value of each cell in the 2D array is the length of the longest path from the top left to that cell. The value of the top left cell is 1. The value of the other cells is the maximum of the value of the cell above and the value of the cell to the left, plus 1. The value of the bottom right cell is the length of the longest path. The time complexity is O(n^2) and the space complexity is O(n^2).
Oct 11