Binary Search

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 Python
Given a sorted array of integers, this function returns the index of a given target value. If the target value is not present in the array, it returns -1.
About this solution: This solution is correct and demonstrates a good understanding of time complexity.
Nov 10
Code Problem / Data Structures and Algorithms DifficultyMedium Python
Given a sorted array of integers and a target value, this function will return the index of the target value if found, or -1 if not found.
About this solution: The candidate's solution is complete and solves the problem. The candidate has used binary search, which is the most efficient way to search a sorted array for a target value.
Nov 05
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem deals with finding a target value in a sorted array of integers. The function should return the index of the target value if it is found in the array, or -1 if it is not found.
About this solution: This solution is optimal because it is O(n) time complexity. However, it only works if the array is sorted. If the array is not sorted, this solution will not work.
Nov 04
Code Problem / Data Structures and Algorithms
This problem requires the use of a binary search algorithm to find a target value in a sorted array. If the target value is found, the index of that value is returned. If the target value is not found, -1 is returned.
About this solution: The candidate's solution is complete and solves the problem. The candidate uses a binary search, which is the most efficient way to search a sorted array.
Oct 23
Code Problem / Data Structures and Algorithms
This problem involves searching for a given value in a sorted array of integers. If the value is found, the index of the target value is returned; if not, -1 is returned.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate has correctly identified the problem and has provided a solution that solves the problem. The candidate's approach is general and uses a binary search algorithm, which is the optimal solution for this problem.
Oct 22
Code Problem / Data Structures and Algorithms
This problem involves searching for a given value in a sorted array of integers. If the value is found, the index of the target value is returned; if not, -1 is returned.
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.
Oct 20