MCQOPTIONS
Bookmark
Saved Bookmarks
→
Computer Science Engineering (CSE)
→
Software Design Modeling in Computer Science Engineering (CSE)
→
The number of comparisons done by sequential searc..
1.
The number of comparisons done by sequential search is ………………
A.
(n/2)+1
B.
(n+1)/2
C.
(n-1)/2
D.
(n+2)/2
Answer» C. (n-1)/2
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
Consider the following statements:i. First-in-first out types of computations are efficiently supported by STACKS.ii. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations.iii. Implementing QUEUES on a circular array is more efficient than implementing QUEUES on a linear array with two indices.iv. Last-in-first-out type of computations are efficiently supported by QUEUES.Which of the following is correct?
Suppose you are given an implementation of a queue of integers. The operations that can be performed on the queue are:i. isEmpty (Q) — returns true if the queue is empty, false otherwise.ii. delete (Q) — deletes the element at the front of the queue and returns its value.iii. insert (Q, i) — inserts the integer i at the rear of the queue.Consider the following function:void f (queue Q) {int i ;if (!isEmpty(Q)) { i = delete(Q); f(Q); insert(Q, i); }}What operation is performed by the above function f ?
What is the functionality of the following code? Choose the most appropriate answer. public int function(){if(head == null)return Integer.MIN_VALUE;int var;Node temp = head;Node cur;while(temp.getNext() != head){cur = temp;temp = temp.getNext();}if(temp == head){var = head.getItem();head = null;return var;}var = temp.getItem();cur.setNext(head);return var;}
public int function(){ if(head == null) return Integer.MIN_VALUE; int var; Node temp = head; while(temp.getNext() != head) temp = temp.getNext(); if(temp == head) { var = head.getItem(); head = null; return var; } temp.setNext(head.getNext()); var = head.getItem(); head = head.getNext(); return var;} What is the functionality of the following code? Choose the most appropriate answer.
Each array declaration need not give, implicitly or explicitly, the information about
……………….. level is where the model becomes compatible executable code
The time complexity of quick sort is …………..
A …………………… does not keep track of address of every element in the list.
Arrays are best data structures …………
…………………. Is a directed tree in which outdegree of each node is less than or equal to two.
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply