Given a sorted array of n integers that has been rotated i(unknown) number of times, give a (log n) algorithm that finds an element in the array.


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More AI Algorithms Interview Questions

Give an algorithm for the following problem. Given a list of n distinct positive integers, partition the list into two sublists, each of size n/2, such that the difference between the sums of the integers in the two sublists is minimized. You may assume that n is a multiple of 2.

0 Answers  


Give a general algorithm for converting a m-array tree to a 2-ary tree.

0 Answers   Tech Mahindra,


What are the complexities of sorting algorithms and how can this complexity be calculated?

0 Answers   Tech Mahindra,


Which search algorithm will use a limited amount of memory in an online search?

0 Answers  


Write a code/algorithm to find the frequency of each element in an array?

0 Answers   ITC Indian Tobacco Company,






What is the bidirectional search algorithm?

0 Answers  


Consider the following algorithm, where the array A is indexed 1 through n: int add_them ( int n , int A[ ] ) { index i , j , k ; j = 0 ; for ( i = 1 ; i <= n ; i++) j = j + A[i] ; k = 1 ; for ( i = 1 ; i <= n ; i++) k = k + k ; return j + k ; } (a) If n = 5 and the array A contains 2, 5, 3, 7, and 8, what is returned? (b) What is the time complexity T(n) of the algorithm?

0 Answers  


A* algorithm is based on which search method?

0 Answers  


What is informed (heuristic) search strategies algorithm?

0 Answers  


Explain the concept behind dead lock avoidance, banker's algorithm.

0 Answers   HPCL, Hughes Systique Corporation,


What is breadth-first search algorithm?

0 Answers  


Consider the following algorithm: for ( i = 2 ; i <= n ; i++) { for ( j = 0 ; j <= n) { cout << i << j ; j = j + floor(n/4) ; } } (a) What is the output when n = 4 (b) What is the time complexity T(n). You may assume that n is divisible 4.

0 Answers  


Categories