Data structure MCQ Quiz Hub

Data Structure (DS) MCQ Set 2

Choose a topic to test your knowledge and improve your Data structure skills

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?





✅ Correct Answer: 3

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 ?





✅ Correct Answer: 2

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?





✅ Correct Answer: 1

Which of the following option is not correct?





✅ Correct Answer: 3

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?





✅ Correct Answer: 1

Overflow condition in linked list may occur when attempting to .............





✅ Correct Answer: 1

Which of the following is not a type of Linked List ?





✅ Correct Answer: 4

Linked list is generally considered as an example of _________ type of memory allocation.





✅ Correct Answer: 2

Each Node contain minimum two fields one field called data field to store data. Another field is of type ____





✅ Correct Answer: 4

If in a linked list address of first node is 1020 then what will be the address of node at 5th position ?





✅ Correct Answer: 4

In Circular Linked List insertion of a node involves the modification of ____ links.





✅ Correct Answer: 4

If a list contains no elements it is said to be





✅ Correct Answer: 2

Linked list uses





✅ Correct Answer: 4

Standard approach for implementation of a list is/are of





✅ Correct Answer: 2

First link node of list is accessed from a pointer named





✅ Correct Answer: 2

A linked list is made up of a set of objects known as





✅ Correct Answer: 1

How do you calculate the pointer difference in a memory efficient double linked list?





✅ Correct Answer: 2

How do you calculate the pointer difference in a memory efficient double linked list?





✅ Correct Answer: 2

Which of the following name does not relate to stacks?





✅ Correct Answer: 1

The postfix form of the expression (A + B)∗(C∗D − E)∗F / G is





✅ Correct Answer: 1

What is the postfix form of the following prefix expression -A/B*C$DE ?





✅ Correct Answer: 1

The data structure required to evaluate a postfix expression is





✅ Correct Answer: 2

What is the postfix form of the following prefix:*+ab–cd





✅ Correct Answer: 1

A queue is a,





✅ Correct Answer: 1

In stack terminology, the __________operations are known as push and pop operations respectively.





✅ Correct Answer: 3

A common example of a queue is people waiting in line at a__________.





✅ Correct Answer: 1

What is one of the common examples of a stack?





✅ Correct Answer: 1

When a stack is organized as an array, a variable named Top is used to point to the top element of the stack. Initially, the value of Top is set to_______to indicate an empty stack.





✅ Correct Answer: 1

What happens when the stack is full and there is no space for a new element, and an attempt is made to push a new element?





✅ Correct Answer: 1

The total number of elements in a stack at a given point of time can be calculated from the value of______.





✅ Correct Answer: 2

When the push operation is performed on stack the value of TOS will be ______





✅ Correct Answer: 2

A double linked list contains reference to _____





✅ Correct Answer: 4

Data Structure that are created by user as per their requirement are known as





✅ Correct Answer: 1

. To insert element at start, the previous pointer of newly added node would point to ______





✅ Correct Answer: 1

In linked list implementation, a node carries information regarding





✅ Correct Answer: 3

Which of the following data structure is linear type?





✅ Correct Answer: 4

Stack is ____ type of data structure.





✅ Correct Answer: 1

In stack deletion operation is referred as _____





✅ Correct Answer: 2

Queue is _____ type of data structure.





✅ Correct Answer: 2

Data structre is divided into _____ parts.





✅ Correct Answer: 2

In ___ Data Structure data can be processed one by one sequentially





✅ Correct Answer: 2

When we insert an element in Queue, which pointer is increased by one?





✅ Correct Answer: 2

Which of the following is not the possible operation on stack?





✅ Correct Answer: 4

Which of the following is a possible operation on queue?





✅ Correct Answer: 4

In stack, to display the lastly inserted element without removing it, which function is used?





✅ Correct Answer: 4

if there are no nodes in linked list then start pointer will point at which value?





✅ Correct Answer: 1

Worst space complexity of queue data structure is





✅ Correct Answer: 1

Worst space complexity of stack data structure is





✅ Correct Answer: 4

Worst space complexity of singly linked list is





✅ Correct Answer: 1

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.





✅ Correct Answer: 2