

MCQOPTIONS
Saved Bookmarks
This section includes 139 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Engineering (CSE) knowledge and support exam preparation. Choose a topic below to get started.
1. |
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? |
A. | (ii) and (iii) are true |
B. | (i) and (ii) are true |
C. | (iii) and (iv) are true |
D. | (ii) and (iv) are true |
Answer» B. (i) and (ii) are true | |
2. |
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 ? |
A. | leaves the queue q unchanged |
B. | reverses the order of the elements in the queue q |
C. | deletes the element at the front of the queue q and inserts it at the rear keeping the other elements in the same order |
D. | empties the queue q |
Answer» C. deletes the element at the front of the queue q and inserts it at the rear keeping the other elements in the same order | |
3. |
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;} |
A. | return data from the end of the list |
B. | returns the data and deletes the node at the end of the list |
C. | returns the data from the beginning of the list |
D. | returns the data and deletes the node from the beginning of the list |
Answer» C. returns the data from the beginning of the list | |
4. |
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. |
A. | return data from the end of the list |
B. | returns the data and deletes the node at the end of the list |
C. | returns the data from the beginning of the list |
D. | returns the data and deletes the node from the beginning of the list |
Answer» E. | |
5. |
Each array declaration need not give, implicitly or explicitly, the information about |
A. | the name of array |
B. | the data type of array |
C. | the first data from the set to be stored |
D. | the index set of the array |
Answer» D. the index set of the array | |
6. |
……………….. level is where the model becomes compatible executable code |
A. | abstract level |
B. | application level |
C. | implementation level |
D. | all of the above |
Answer» D. all of the above | |
7. |
The time complexity of quick sort is ………….. |
A. | o(n) |
B. | o(n2) |
C. | o(n log n) |
D. | o(log n) |
Answer» D. o(log n) | |
8. |
A …………………… does not keep track of address of every element in the list. |
A. | stack |
B. | string |
C. | linear array |
D. | queue |
Answer» D. queue | |
9. |
Arrays are best data structures ………… |
A. | for relatively permanent collections of data |
B. | for the size of the structure and the data in the structure are constantly changing |
C. | for both of above situation |
D. | for none of the above |
Answer» B. for the size of the structure and the data in the structure are constantly changing | |
10. |
…………………. Is a directed tree in which outdegree of each node is less than or equal to two. |
A. | unary tree |
B. | binary tree |
C. | trinary tree |
D. | both b and c |
Answer» C. trinary tree | |
11. |
In general, the binary search method needs no more than ……………. comparisons. |
A. | [log2n]-1 |
B. | [logn]+1 |
C. | [log2n] |
D. | [log2n]+1 |
Answer» E. | |
12. |
In ……………, search start at the beginning of the list and check every element in the list. |
A. | linear search |
B. | binary search |
C. | hash search |
D. | binary tree search |
Answer» B. binary search | |
13. |
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 | |
14. |
In the …………….. traversal we process all of a vertex’s descendants before we move to an adjacent vertex. |
A. | depth first |
B. | breadth first |
C. | with first |
D. | depth limited |
Answer» B. breadth first | |
15. |
Herder node is used as sentinel in ….. |
A. | graphs |
B. | stacks |
C. | binary tree |
D. | queues |
Answer» D. queues | |
16. |
Which of the following data structure can’t store the non-homogeneous data elements? |
A. | arrays |
B. | records |
C. | pointers |
D. | stacks |
Answer» B. records | |
17. |
A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called …… |
A. | avl tree |
B. | red-black tree |
C. | lemma tree |
D. | none of the above |
Answer» E. | |
18. |
Which of the following statement is true?i) Using singly linked lists and circular list, it is not possible to traverse the list backwards.ii) To find the predecessor, it is required to traverse the list from the first node in case of singly linked list. |
A. | i-only |
B. | ii-only |
C. | both i and ii |
D. | none of the above |
Answer» D. none of the above | |
19. |
The term "push" and "pop" is related to the |
A. | array |
B. | lists |
C. | stacks |
D. | all of the above |
Answer» D. all of the above | |
20. |
Which data structure allows deleting data elements from front and inserting at rear? |
A. | stacks |
B. | queue |
C. | dequeue |
D. | binary search tree |
Answer» C. dequeue | |
21. |
node.next -> node.next.next; will make |
A. | node.next inaccessible |
B. | node.next.next inaccessible |
C. | this node inaccessible |
D. | none of the above |
Answer» B. node.next.next inaccessible | |
22. |
A circular linked list can be used for |
A. | stack |
B. | queue |
C. | both stack & queue |
D. | neither stack or queue |
Answer» D. neither stack or queue | |
23. |
In doubly linked lists |
A. | a pointer is maintained to store both next and previous nodes. |
B. | two pointers are maintained to store next and previous nodes. |
C. | a pointer to self is maintained for each node. |
D. | none of the above |
Answer» C. a pointer to self is maintained for each node. | |
24. |
A linear list in which each node has pointers to point to the predecessor and successors nodes is called as |
A. | singly linked list |
B. | circular linked list |
C. | doubly linked list |
D. | linear linked list |
Answer» D. linear linked list | |
25. |
The situation when in a linked list START=NULL is |
A. | underflow |
B. | overflow |
C. | housefull |
D. | saturated |
Answer» B. overflow | |
26. |
In doubly linked lists, traversal can be performed? |
A. | only in forward direction |
B. | only in reverse direction |
C. | in both directions |
D. | none of the above |
Answer» D. none of the above | |
27. |
What differentiates a circular linked list from a normal linked list? |
A. | you cannot have the ‘next’ pointer point to null in a circular linked list |
B. | it is faster to traverse the circular linked list |
C. | you may or may not have the ‘next’ pointer point to null in a circular linked list |
D. | head node is known in circular linked list |
Answer» D. head node is known in circular linked list | |
28. |
How do you count the number of elements in the circular linked list? |
A. | public int length(node head) { int length = 0; if( head == null) return 0; node temp = head.getnext(); while(temp != head) { temp = temp.getnext(); length++; } return length; } |
B. | public int length(node head) { int length = 0; if( head == null) return 0; node temp = head.getnext(); while(temp != null) { temp = temp.getnext(); length++; } return length; } |
C. | public int length(node head) { int length = 0; if( head == null) return 0; node temp = head.getnext(); while(temp != head && temp != null) { temp = head.getnext(); length++; } return length; } |
D. | public int length(node hea { int length = 0; if( head == null) return 0; node temp = head.getnext(); while(temp != head && temp == null) { temp = head.getnext(); length++; } return length; } |
Answer» B. public int length(node head) { int length = 0; if( head == null) return 0; node temp = head.getnext(); while(temp != null) { temp = temp.getnext(); length++; } return length; } | |
29. |
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. |
A. | return data from the end of the list |
B. | returns the data and deletes the node at the end of the list |
C. | returns the data from the beginning of the list |
D. | returns the data and deletes the node from the beginning of the list |
Answer» E. | |
30. |
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; } |
A. | return data from the end of the list |
B. | returns the data and deletes the node at the end of the list |
C. | returns the data from the beginning of the list |
D. | returns the data and deletes the node from the beginning of the list |
Answer» C. returns the data from the beginning of the list | |
31. |
How do you insert a node at the beginning of the list? |
A. | public class insertfront(int data) { node node = new node(data, head, head.getnext()); node.getnext().setprev(node); head.setnext(node); size++; } |
B. | public class insertfront(int data) { node node = new node(data, head, head); node.getnext().setprev(node); head.setnext(node); size++; } |
C. | public class insertfront(int data) { node node = new node(data, head, head.getnext()); node.getnext().setprev(head); head.setnext(node); size++; } |
D. | public class insertfront(int data) { node node = new node(data, head, head.getnext()); node.getnext().setprev(node); head.setnext(node.getnext()); size++; } |
Answer» B. public class insertfront(int data) { node node = new node(data, head, head); node.getnext().setprev(node); head.setnext(node); size++; } | |
32. |
What is a dequeue? |
A. | a queue with insert/delete defined for both front and rear ends of the queue |
B. | a queue implemented with a doubly linked list |
C. | a queue implemented with both singly and doubly linked lists |
D. | a queue with insert/delete defined for front side of the queue |
Answer» B. a queue implemented with a doubly linked list | |
33. |
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are |
A. | full: (rear+1) mod n == front, empty: rear == front |
B. | full: (rear+1) mod n == front, empty: (front+1) mod n == rear |
C. | full: rear == front, empty: (rear+1) mod n == front |
D. | full: (front+1) mod n == rear, empty: rear == front |
Answer» B. full: (rear+1) mod n == front, empty: (front+1) mod n == rear | |
34. |
Suppose implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack? |
A. | a queue cannot be implemented using this stack. |
B. | a queue can be implemented where enqueue takes a single instruction and dequeue takes a sequence of two instructions. |
C. | a queue can be implemented where enqueue takes a sequence of three instructions and dequeue takes a single instruction. |
D. | a queue can be implemented where both enqueue and dequeue take a single instruction each. |
Answer» D. a queue can be implemented where both enqueue and dequeue take a single instruction each. | |
35. |
Which of the following option is not correct? |
A. | if the queue is implemented with a linked list, keeping track of a front pointer, only rear pointer s will change during an insertion into an non-empty queue. |
B. | queue data structure can be used to implement least recently used (lru) page fault algorithm and quick short algorithm. |
C. | queue data structure can be used to implement quick short algorithm but not least recently used (lru) page fault algorithm. |
D. | both (a) and (c) |
Answer» D. both (a) and (c) | |
36. |
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 ? |
A. | leaves the queue q unchanged |
B. | reverses the order of the elements in the queue q |
C. | deletes the element at the front of the queue q and inserts it at the rear keeping the other elements in the same order |
D. | empties the queue q |
Answer» C. deletes the element at the front of the queue q and inserts it at the rear keeping the other elements in the same order | |
37. |
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? |
A. | (ii) and (iii) are true |
B. | (i) and (ii) are true |
C. | (iii) and (iv) are true |
D. | (ii) and (iv) are true |
Answer» B. (i) and (ii) are true | |
38. |
Consider a standard Circular Queue 'q' implementation (which has the same condition for Queue Full and Queue Empty) whose size is 11 and the elements of the queue are q[0], q[1], q[2].....,q[10]. The front and rear pointers are initialized to point at q[2] . In which position will the ninth element be added? |
A. | q[0] |
B. | q[1] |
C. | q[9] |
D. | q[10] |
Answer» B. q[1] | |
39. |
Overflow condition in linked list may occur when attempting to ............. |
A. | create a node when free space pool is empty |
B. | traverse the nodes when free space pool is empty |
C. | create a node when linked list is empty |
D. | none of these |
Answer» B. traverse the nodes when free space pool is empty | |
40. |
Linked list is generally considered as an example of _________ type of memory allocation. |
A. | static |
B. | dynamic |
C. | compile time |
D. | none of these |
Answer» C. compile time | |
41. |
Which of the following is not a type of Linked List ? |
A. | doubly linked list |
B. | singly linked list |
C. | circular linked list |
D. | hybrid linked list |
Answer» E. | |
42. |
Each Node contain minimum two fields one field called data field to store data. Another field is of type _________. |
A. | pointer to class |
B. | pointer to an integer |
C. | pointer to character |
D. | pointer to node |
Answer» E. | |
43. |
If in a linked list address of first node is 1020 then what will be the address of node at 5th position ? |
A. | 1036 |
B. | 1028 |
C. | 1038 |
D. | none of these |
Answer» E. | |
44. |
Linked list uses |
A. | random memory allocation |
B. | static memory allocation |
C. | fixed memory allocation |
D. | dynamic memory allocation |
Answer» E. | |
45. |
In Circular Linked List insertion of a node involves the modification of ____ links. |
A. | 3 |
B. | 4 |
C. | 1 |
D. | 2 |
Answer» E. | |
46. |
If a list contains no elements it is said to be |
A. | hollow |
B. | empty |
C. | finite |
D. | infinite |
Answer» C. finite | |
47. |
First link node of list is accessed from a pointer named |
A. | tail |
B. | head |
C. | terminator |
D. | initiator |
Answer» C. terminator | |
48. |
A linked list is made up of a set of objects known as |
A. | nodes |
B. | arrays |
C. | entities |
D. | instances |
Answer» B. arrays | |
49. |
Standard approach for implementation of a list is/are of |
A. | 1 type |
B. | 2 type |
C. | 3 type |
D. | 4 type |
Answer» C. 3 type | |
50. |
How do you calculate the pointer difference in a memory efficient double linked list? |
A. | head xor tail |
B. | pointer to previous node xor pointer to next node |
C. | pointer to previous node – pointer to next node |
D. | pointer to next node – pointer to previous node |
Answer» C. pointer to previous node – pointer to next node | |