Data structure MCQ Quiz Hub

Data Structures

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

"Following is C like pseudo code of a function that takes a number as an argument, and uses a stack S to do processing. void fun(int n) { Stack S; // Say it creates an empty stack S while "





✅ Correct Answer: 2

Which one of the following is an application of Stack Data Structure?





✅ Correct Answer: 4

Which of the following is true about linked list implementation of stack?





✅ Correct Answer: 4

Consider the following pseudocode that uses a stack declare a stack of characters while ( there are more characters in the word to read ) { read a character push the character on the stack





✅ Correct Answer: 4

The following postfix expression with single digit operands is evaluated using a stack: 8 2 3 ^ / 2 3 * + 5 1 * - Note that ^ is the exponentiation operator. The top two elements of t





✅ Correct Answer: 3

Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in sequence, and then perform n pop operations. Assume that Push and Pop operation take X se





✅ Correct Answer: 3

A single array A[1..MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top1 and top2 (topl< top 2) point to the location of the topmost element in





✅ Correct Answer: 2

Assume that the operators +, -, × are left associative and ^ is right associative. The order of precedence (from highest to lowest) is ^, x , +, -. The postfix expression corresponding to the infix ex





✅ Correct Answer: 1

To evaluate an expression without any embedded function calls:





✅ Correct Answer: 1

The result evaluating the postfix expression 10 5 + 60 6 / * 8 – is





✅ Correct Answer: 2

A function f defined on stacks of integers satisfies the following properties. f(∅) = 0 and f (push (S, i)) = max (f(S), 0) + i for all stacks S and integers i. If a stack S contains the intege





✅ Correct Answer: 4

0





✅ Correct Answer: 3

Suppose a stack is to be implemented with a linked list instead of an array. What would be the effect on the time complexity of the push and pop operations of the stack implemented using linked list (





✅ Correct Answer: 2

Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and then increasing downwards). Give





✅ Correct Answer: 1

A priority queue Q is used to implement a stack S that stores characters. PUSH(C) is implemented as INSERT(Q, C, K) where K is an appropriate integer key chosen by the implementation. POP is implement





✅ Correct Answer: 4

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 LIST





✅ Correct Answer: 1

Which of the following permutation can be obtained in the same order using a stack assuming that input is the sequence 5, 6, 7, 8, 9 in that order?





✅ Correct Answer: 3

The minimum number of stacks needed to implement a queue is





✅ Correct Answer: 3

The best data structure to check whether an arithmetic expression has balanced parenthesis is a





✅ Correct Answer: 4

The seven elements A, B, C, D, E, F and G are pushed onto a stack in reverse order, i.e., starting from G. The stack is popped five times and each element is inserted into a queue.Two elements are del





✅ Correct Answer: 2

If the sequence of operations - push (1), push (2), pop, push (1), push (2), pop, pop, pop, push (2), pop are performed on a stack, the sequence of popped out values





✅ Correct Answer: 1

The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the





✅ Correct Answer: 4

Consider the following operations performed on a stack of size 5 : Push (a); Pop() ; Push(b); Push(c); Pop(); Push(d); Pop();Pop(); Push (e) Which of the following statements is correct?





✅ Correct Answer: 2

Which of the following is not an inherent application of stack?





✅ Correct Answer: 3

Stack A has the entries a, b, c (with a on top). Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B. An entry popped out of the stack B can be only be pri





✅ Correct Answer: 3

Convert the following infix expression into its equivalent post fix expression (A + B^ D) / (E * F) + G





✅ Correct Answer: 1

Best Data Structure for Searching?





✅ Correct Answer: 4

Worst Time complexity for searching an element in Binary search tree is:





✅ Correct Answer: 2

Balancing Factor of each node in AVL tree may be:-





✅ Correct Answer: 4

Balancing Factor of each node in B and B+ tree is





✅ Correct Answer: 2

Which of the following tree support the sequential search?





✅ Correct Answer: 3

Which of the following are true:





✅ Correct Answer: 3

Which of the following are true:





✅ Correct Answer: 4

After insertion the following node in AVL tree what will be the root node ? 10,20,30,40,50,15,5





✅ Correct Answer: 2

Which of the following are True?





✅ Correct Answer: 3

In max Heap, the cost of finding smallest number is:-





✅ Correct Answer: 2

In max Heap, the cost of finding largest element is :-





✅ Correct Answer: 4

In min Heap, the cost of finding smallest elements is:-





✅ Correct Answer: 2

Which of the following sorting are the stable sorting:-





✅ Correct Answer: 4

The cost of construct the Heap is :-





✅ Correct Answer: 2

Hashing is a powerful data structure for the:-





✅ Correct Answer: 2

Consider the postfix expression 2 3 2 * 6 / 5 + + 8 / 1 + Solve this expression by using stack and it give:-





✅ Correct Answer: 1

The following node are inserted sequentially in Binary search tree:- 30,3,50,10,5,70,80,75,60,45 what will be the Inorder of above BST?





✅ Correct Answer: 1

The following node are inserted sequentially in Binary search tree:- 30,3,50,10,5,70,80,75,60,45 what will be the preorder of above BST?





✅ Correct Answer: 4

int func(struct node *ptr) { if(ptr==NULL) return; func(ptr->left); printf("%d",ptr->data); func(ptr->right); } The above function computes the :-





✅ Correct Answer: 2

int func(struct node *ptr) { if(ptr==NULL) return; printf("%d",ptr->data); func(ptr->left); func(ptr->right); } The above function computes the :-





✅ Correct Answer: 3

int func(struct node *ptr) { if(ptr==NULL) return; func(ptr->left); func(ptr->right); printf("%d",ptr->data); } The above function computes the :-





✅ Correct Answer: 1

Stack is implemented by:-





✅ Correct Answer: 2

In circular link list, the last node contain the address of the:-





✅ Correct Answer: 2

Array is collection of similar data type while structure is collection of:-





✅ Correct Answer: 3