-
Marbles and Floors
You have a 100-story building and a couple of marbles. You must identify thelowest floor for which a marble will break if you drop it from this floor. How fastcan you find this floor if you are given an infinite supply of marbles? What if youhave only two marbles?
-
Sorted Matrix
You are given a matrix. The matrix elements are such that they are sorted both horizontally and vertically. Given an element of the matrix, your job is to obtain its position in an efficient manner.Example: 10 20 30 15 35 98 48 76 110Input: 76Output: 3rd row, 2nd column.
-
Duplicate Elements Array
You have an array of size '2n' of these, 'n+1' elements are distinct and 1 element is repeated 'n' times. You must find the repeated element and say how many times it has repeated. Your solution must use minimum no. of comparisons. Also, say how many comparisons your solution will make in the worst case?
-
sub matrix
u are given a n*n square matrix where each element is either 0 or 1....u have to find the square submatrix with the largest length such that all the elements along the border of that square submatrix matrix is 1 ....