Deriving time complexity of a function
<p>This following program is for searching two dimensional square array of positive integers with sorted rows and columns in non-decreasing order. The program returns true if target (value) element exist in array, false otherwise.
I need to design algorithm for this task which will be as efficient as possible. 
I wrote this code, but i do not know how to derive the worst case run time complexity function using summations. I assume that the my solution is order O(n) in the worst case. but i do not know how to show it mathematically (using summations and etc). </p>
