Thursday, July 22, 2010
Basic interview question
Do not come to me if you don't know how to answer it!!
how to search a number in a 2d matrix which is sorted both row wise and column wise
how to search a number in a 2d matrix which is sorted both row wise and column wise
Subscribe to:
Post Comments (Atom)
2 comments:
Even Write a C code to reverse a linked list falls under this category. :)
Reply Delete1. Start at bottom left corner of the array.
Reply Delete2. Move right if the element is bigger otherwise move up if the element is smaller.
3. Repeat the above step till match is found or top-right is reached.