Do a binary search in each row or column. If there are m rows and n columns, this is O(m log n) or O(n log m), respectively.
Dave On Nov 13, 10:11 am, geekko <[EMAIL PROTECTED]> wrote: > Given a matrix all whose columns and rows are individually sorted, how > do you search a number in it? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---
