Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
224 views

Leetcode #826. Most Profit Assigning Work solution in Java (Sort + Binary Search)

Problem Statement: We have jobs: difficulty[i] is the difficulty of the ith job, and profit[i] is the profit of the ith job....
Marko Cain's user avatar
1 vote
1 answer
695 views

Find maximum in sorted and rotated array

This is an interview question. A sorted rotated array is a sorted array which was rotated 0 or more times. For example: [1,2,3] -> [2,3,1] ...
Rodrigo's user avatar
  • 21
2 votes
0 answers
989 views

Three sum using binary search

Given an array and a value, find all the triplets in the array whose sum is equal to the given value. For example, if the given array is {12, 3, 4, 1, 6, 9} and the ...
Exploring's user avatar
  • 345
7 votes
3 answers
5k views

Searching in a sorted 2D matrix

If I was at an interview, and wrote this code, what would you think? Please be brutal. Time it took to wrote it: 13 minutes Problem: Write an efficient algorithm that searches for a value in an m x n ...
bazang's user avatar
  • 2,236
4 votes
2 answers
66k views

Deleting a node from a binary search tree

I have read about it at a few places and tried to write my own version. I would like to get it reviewed. ...
daydreamer's user avatar