Detail Form
We will send your result on your email id and phone no. please fill detail
Search Operation
In a sorted array, the search operation can be performed by using binary search.
Input Format:
The first line of input consists of T, the number of test cases. T testcases follow. Each testcase contains 3 lines of input. The first line of every test case consists of an integer N, denotes the number of elements in an array. The second line of every test cases consists of N spaced integers Ai. and last the value to be search in array.
Time Complexity of Search Operation: O(Log n) [Using Binary Search]
Before Insertion: 12 16 20 40 50 70 After Insertion: 12 16 20 26 40 50 70
Time Complexity of Insert Operation: O(n) [In the worst case all elements may have to be moved]
Time Complexity of Delete Operation: O(n) [In the worst case all elements may have to be moved]