GeekInterview.com
Answered Questions

Sorted matrix

Asked By: hari_nowayout | Asked On: Aug 27th, 2008

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.

Answered by: sandy on: Mar 24th, 2013

I assume you can do it in the following way: "python class Coordinate: def __init__(self,x=0,y=0): self.x = x self.y = y def findElement(a,n): if a == Non...

Answered by: frogInSea on: Mar 14th, 2013

I think it can be solved in a two dimensional Binary-Search way

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us: