yes. you are calucation is wrong in >>" You are againing need to do n/2 * n/2 comparing... ".
moving heads in step 3 will take only O(n). T(n) = O(n). please see the step 3 again/.
yes. you are calucation is wrong in >>" You are againing need to do n/2 * n/2 comparing... ".
moving heads in step 3 will take only O(n). T(n) = O(n). please see the step 3 again/.