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]
A step array is an array of integers where each element has a difference of at most k with its neighbor. Given a key x, we need to find the index value of x if multiple-element exist to return the first occurrence of the key.
Implement a Queue using 2 stacks s1 and s2 .
A Query Q is of 2 Types
(i) 1 x (a query of this type means pushing 'x' into the queue)
(ii) 2 (a query of this type means to pop element from queue and print the poped element)
Example 1:
Example 2: