For (I Pos I 1 I - ) (A (I) A (I+1) ) For (I N I Pos I - ) (A (I) A (I+1) ) For (I Pos I
For (I Pos I 1 I - ) (A (I) A (I+1) ) For (I N I Pos I - ) (A (I) A (I+1) ) For (I Pos I
For (I Pos I 1 I - ) (A (I) A (I+1) ) For (I N I Pos I - ) (A (I) A (I+1) ) For (I Pos I
Same
10,10, 20, 20, 30, 40
10,30, 20, 0, 0, 40
LIFO
FIFO
BOTH A and B
NONE
What is the advantage of linear search
Fast
Time consuming
Needs a sorted array
Does not needs a sorted array
ALL
Fast
Time consuming
Needs a sorted array
Does not needs a sorted array
ALL
If the search item lies in the upper half in case of binary
search which is the correct set of statements.
Top = mid + 1;
Top = mid - 1;
Bot = mid + 1;
Bot = mid - 1;
An array is a
In a heap
Popped out of stack
Sorted
Unsorted