Trivial algorithm : (Assuming it is in ascending order in both columns and
rows)

logarithmic time in max(n,m)

Divide the 2-d table to 4 parts, the -right-bottom-most and the
left-bottom-most are the smallest and largest values in the subtable.
It should be clear that atleast two subtables can be rejected
straightforward from just this info.

Hence the complexity

T(m,n)  = 2 * T(m/4,n/4) + c

Rohit Saraf
Third Year Undergraduate
Compter Science & Engineering
IIT Bombay

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to