Copleted 1 problem - #1360
Conversation
Interview Problem: Find Missing Number in a sorted array (Problem1.java)Your solution attempts a binary search approach, which is the right idea for O(log n) performance. However, there are several issues to address:
static int missingNumber(int[] arr) {
int low = 0, high = arr.length - 1;
while (high - low > 1) {
int mid = low + (high - low) / 2;
if (arr[low] - low != arr[mid] - mid)
high = mid;
else
low = mid;
}
return arr[low] + 1;
}
VERDICT: NEEDS_IMPROVEMENT Interview Problem: Design Min HeapYour submission does not address the problem at all. The problem requires you to implement a Min Heap data structure with the following operations:
Your code appears to be a solution for a different problem (finding a missing number in an array). Additionally, your code has several compilation errors:
Please re-read the problem carefully and implement a Min Heap using an array-based approach. You'll need:
VERDICT: NEEDS_IMPROVEMENT |
No description provided.