Algorithms

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#
To find the maximum depth of a binary tree, we can use recursion. First, we need to check if the tree is empty. If not, we need to find the maximum depth of the left and right subtrees. The maximum depth of the tree is the maximum of the left and right subtrees' depths, plus one.
About this solution: The candidate's solution correctly finds the maximum depth of a binary tree. The solution uses a recursive approach, which is a good approach for this problem. The solution is clear and easy to understand.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
This technical problem deals with finding the sum of all integers in a list using recursion. An example input is given, along with the expected output.
About this solution: This solution is correct and demonstrates a good understanding of recursion. The approach is clear and concise.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem is about finding the shortest path through a maze. The input is a 2D array representing the maze, and the output is the shortest path from the top-left corner to the bottom-right corner.
About this solution: The candidate's solution correctly solves the problem and demonstrates a level of completeness. The candidate uses a breadth-first search algorithm to find the shortest path through the maze. The time and space complexity of the algorithm is correctly analyzed.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium C#
The problem asks you to implement a binary search function that takes in a sorted array of integers and a target integer. The function should return the index of the target integer if it is found in the array, or -1 if it is not found.
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The candidate's approach is not clear.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This problem asks you to write a function that takes in a list of integers and returns the sum of the integers at even indices. For example, given the input list [1, 2, 3, 4, 5], the function should return 6 (2 + 4).
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The general approach is not clear.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium C#
The greatest common divisor of two positive integers can be found by recursively dividing the larger number by the smaller number until the remainder is 0.
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The general approach is not clear.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium C++
The shortest path between two nodes in an undirected graph can be found by traversing the graph from one node to the other.
About this solution: The candidate's solution is complete and solves the problem. The candidate uses a breadth-first search approach to find the shortest path between two nodes.
Nov 29
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem asks us to find the first non-repeating character in a given string. For example, if the string is "GeeksforGeeks", then the first non-repe ating character is 'f'.
About this solution: The candidate's solution is correct and uses a dictionary to store the characters and their counts. The time complexity of this solution is O(n) because the dictionary is iterated through once. The space complexity of this solution is O(n) because the dictionary is the same size as the input string.
Nov 29