No, First we are finding the correct row position, and then in that row, we are finding the correct position to enter the element with its priority which here is 11, and this operation of finding the correct position is being performed for a particular row and not for all the rows in the matrix.
Isn't it O(root(n) * root(n)) = O(n)
No, First we are finding the correct row position, and then in that row, we are finding the correct position to enter the element with its priority which here is 11, and this operation of finding the correct position is being performed for a particular row and not for all the rows in the matrix.
It is O(2* sqrt(n)) which is O(sqrt(n))