MCQOPTIONS
Saved Bookmarks
This section includes 50 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures Mcqs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
A .. is a linear list in which insertions and deletions are made to from either end of the structure. |
| A. | Circular queue |
| B. | Random of queue |
| C. | Priority |
| D. | Dequeue |
| Answer» E. | |
| 2. |
An infix expression can be converted to a postfix expression using a .. |
| A. | Stack |
| B. | Queue |
| C. | Dequeue |
| D. | None of these |
| Answer» B. Queue | |
| 3. |
Aposterior analysis are more accurate than apriori analysis because |
| A. | It contains the real data. |
| B. | It assumes all other factors to be dynamic. |
| C. | It assumes all other factors to be constant. |
| D. | It is a result of reverse-engineering. |
| Answer» C. It assumes all other factors to be constant. | |
| 4. |
Assume that the operators +,-, X are left associative and ^ is right associative.The order of precedence (from highest to lowest) is ^, X, +, -. The postfix expression for the infix expression a + b X c d ^ e ^ f is |
| A. | Abc X+ def ^^ |
| B. | Abc X+ de^f^ |
| C. | Ab+c Xd e ^f^ |
| D. | -+aXbc^ ^def |
| Answer» B. Abc X+ de^f^ | |
| 5. |
Consider these functions:push() : push an element into the stackpop() : pop the top-of-the-stack elementtop() : returns the item stored in top-of-the-stack-nodeWhat will be the output after performing these sequence of operationspush(20);push(4);top();pop();pop();pop();push(5);top(); |
| A. | 20 |
| B. | 4 |
| C. | Stack underflow |
| D. | 5 |
| Answer» E. | |
| 6. |
Convert the following infix expression to postfix expression -A / B ^ C + D * E A * C |
| A. | A B C / ^ D E * + A C * - |
| B. | A B C ^ / D * E + A C * - |
| C. | A B C ^ / D E * + A * C - |
| D. | A B C ^ / D E * + A C * - |
| Answer» E. | |
| 7. |
Convert the following infix expression to postfix expression -B * C C + D / A / ( E + E ) |
| A. | B C * C - D A / E E + / + |
| B. | B C C * - D A / E E + / + |
| C. | B C C - * D A / E E + / + |
| D. | B C C - * D / A E E + / + |
| Answer» B. B C C * - D A / E E + / + | |
| 8. |
Convert the following infix expressions into its equivalent postfix expressions(A + B D)/(E F)+G |
| A. | (A B D + E F / G +) |
| B. | (A B D + E F / G +) |
| C. | (A B D + E F/- G +) |
| D. | None of the mentioned |
| Answer» B. (A B D + E F / G +) | |
| 9. |
Expression1 * 2 ^ 3 * 4 ^ 5 * 6is evaluated as |
| A. | 32^30 |
| B. | 173458 |
| C. | 162^30 |
| D. | 49152 |
| Answer» E. | |
| 10. |
Given below is the Node class to perform basic list operations and a Stack class with a no arg constructor. Select from the options the appropriate push() operation that can be included in the Stack class. Also first is the top-of-the-stack. |
| A. | A |
| B. | B |
| C. | C |
| D. | D |
| Answer» B. B | |
| 11. |
Given below is the Node class to perform basic list operations and a Stack class with a no arg constructor.Select from the options the appropriate pop() operation that can be included in the Stack class. Also first is the top-of-the-stack. |
| A. | A |
| B. | B |
| C. | C |
| D. | D |
| Answer» B. B | |
| 12. |
A data structure where elements can be added or removed at either end but not in the middle is called |
| A. | Linked lists |
| B. | Stacks |
| C. | Queues |
| D. | Dequeue |
| Answer» E. | |
| 13. |
A queue data-structure can be used for |
| A. | Expression parsing |
| B. | Recursion |
| C. | Resource allocation |
| D. | All of the above |
| Answer» D. All of the above | |
| 14. |
A . is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out. |
| A. | Queue linked list |
| B. | Stacks linked list |
| C. | Both of them |
| D. | Neither of them |
| Answer» B. Stacks linked list | |
| 15. |
What is the value of the postfix expression 6 3 2 4 + *: |
| A. | Something between -5 and -15 |
| B. | Something between 5 and -5 |
| C. | Something between 5 and 15 |
| D. | Something between 15 and 100 |
| Answer» E. | |
| 16. |
What will be the postfix expression for following infix expression A + B * C ^ D |
| A. | ABCD*+^ |
| B. | ABC+D*^ |
| C. | ABCD+*^ |
| D. | ABCD^*+ |
| Answer» E. | |
| 17. |
What will be the postfix expression for following infix expression A / B ^ C D |
| A. | A B / ^ C D - |
| B. | A B ^ / C D - |
| C. | A B C ^ / D - |
| D. | A B C / ^ D - |
| Answer» D. A B C / ^ D - | |
| 18. |
What will be the postfix form of the above expression -(A+B) (C D-E) F/G |
| A. | A B + C D E F G / |
| B. | A B + C D E F G / |
| C. | A B + C D E F G / |
| D. | None of these |
| Answer» C. A B + C D E F G / | |
| 19. |
User perform following operations on stack of size 5 then -push(1);pop();push(2);push(3);pop();push(4);pop();pop();push(5);at the end of last operation, total number of elements present in the stack are |
| A. | 3 |
| B. | 4 |
| C. | 2 |
| D. | 1 |
| Answer» E. | |
| 20. |
Using Pop (S1,Item) ,Push(S1, Item), Getlist(Item), Pop(S2,Item), and the variables S1,S2(stacks with Top1 and Top2) and Item and given the input file: A,B,C,D,E,F Which stack are possible? |
| A. | No possible stacks with A,B,C,D,E and F |
| B. | All possible stacks with A,B,C,D,E and F |
| C. | Twice as many stacks as can be produced with S1 alone |
| D. | Exact and only those stacks which can be produced with S1 alone |
| Answer» B. All possible stacks with A,B,C,D,E and F | |
| 21. |
Using Pop(S1, Item) Push(S1,Item) Read(Item) Print(Item) the variables S1 represents (stack) and Item are given the input file: A,B,C,D,E,F Which stacks are possible: |
| A. | 54 3 F2 D1 B |
| B. | 5 4 3 D2 A1 F |
| C. | 543 C2 E1 B |
| D. | 5 A4 B3 C2 D1 E |
| Answer» B. 5 4 3 D2 A1 F | |
| 22. |
The postifx expression for the infix expression A + B* (C+D) / F + D*E is |
| A. | AB+CD + *F/ D+E* |
| B. | A + *BCD/ F* DE ++ |
| C. | A*B + CD / F* DE ++ |
| D. | ABCD + *F / + DE* + |
| Answer» E. | |
| 23. |
The prefix form of an infix expression p + q r * t is? |
| A. | + pq *rt |
| Answer» D. | |
| 24. |
The prefix form of an infix expression p + q r t* is |
| A. | + pq rt |
| B. | - +*pqrt |
| Answer» D. | |
| 25. |
The result of evaluating the following postfix expression is5, 7, 9, *, +, 4, 9, 3, /, +, |
| A. | 50 |
| B. | 65 |
| C. | 61 |
| D. | 70 |
| Answer» D. 70 | |
| 26. |
The term push and pop is related to the |
| A. | Array |
| B. | Lists |
| C. | Stacks |
| D. | All of above |
| Answer» D. All of above | |
| 27. |
What are the sequence of popped out values 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. |
| A. | 2, 2, 1, 1, 2 |
| B. | 2, 2, 1, 2, 2 |
| C. | 2, 1, 2, 2, 1 |
| D. | 2, 1, 2, 2, 2 |
| Answer» B. 2, 2, 1, 2, 2 | |
| 28. |
The minimum number of multiplications and additions required to evaluate the polynomialP = 4 3+3 2-15x+45 is |
| A. | 6 & 3 |
| B. | 4 & 2 |
| C. | 3 & 3 |
| D. | 8 & 3 |
| Answer» D. 8 & 3 | |
| 29. |
n elements of a Queue are to be reversed using another queue. The number of ADD and REMOVE operations required to do so is: |
| A. | 2*n |
| B. | 4*n |
| C. | N |
| D. | The task cannot be accomplished |
| Answer» E. | |
| 30. |
Number of ADD and REMOVE operations required to access n/2th elements of a queue of n elements so that the original queue remain the same after the access is (take help of another queue.) |
| A. | 2*n |
| B. | 4*n |
| C. | 8*n |
| D. | 8*n-1 |
| Answer» C. 8*n | |
| 31. |
One can convert an infix expression to a postfix expression using a .. |
| A. | Stack |
| B. | Queue |
| C. | Deque |
| D. | None of these |
| Answer» B. Queue | |
| 32. |
One can determine whether an infix expression has balanced parenthesis or not by using . |
| A. | Array |
| B. | Queue |
| C. | Stack |
| D. | Tree |
| Answer» D. Tree | |
| 33. |
Post fix form of following infix expression is * + A B C D |
| A. | ABCD + - * |
| B. | AB + CD - * |
| C. | AB + CD * - |
| D. | AB + C - D * |
| Answer» C. AB + CD * - | |
| 34. |
Post fix form of following infix expression is -(A + B) * (C + D E) * F |
| A. | AB + CDE + - * F * |
| B. | ABCDEF*-+*+ |
| C. | AB + CD - EF + - * * |
| D. | AB + CD + E - * F * |
| Answer» B. ABCDEF*-+*+ | |
| 35. |
Post fix form ofA + (B * C)is |
| A. | AB * C + |
| B. | ABC * + |
| C. | AB + C * |
| D. | ABC + * |
| Answer» C. AB + C * | |
| 36. |
In a priority queue, insertion and deletion takes place at |
| A. | Front, rear end |
| B. | Only at rear end |
| C. | Only at front end |
| D. | Any position |
| Answer» E. | |
| 37. |
In a queue, the initial values of front pointer f rare pointer r should be .. and .. respectively. |
| A. | 0 and 1 |
| B. | 0 and -1 |
| C. | -1 and 0 |
| D. | 1 and 0 |
| Answer» C. -1 and 0 | |
| 38. |
In C programming, when we remove an item from bottom of the stack, then |
| A. | The stack will fall down. |
| B. | Stack will rearranged items. |
| C. | It will convert to LIFO |
| D. | This operation is not allowed. |
| Answer» C. It will convert to LIFO | |
| 39. |
Inserting an item into the stack when stack is not full is called . Operation and deletion of item form the stack, when stack is not empty is called ..operation. |
| A. | Push, pop |
| B. | Pop, push |
| C. | Insert, delete |
| D. | Delete, insert |
| Answer» B. Pop, push | |
| 40. |
The data structure needed to convert a recursion to an iterative procedure is |
| A. | Queue |
| B. | Graph |
| C. | Stack |
| D. | Tree |
| Answer» D. Tree | |
| 41. |
The postfix equivalent of the prefix * + a b c d is |
| A. | Ab+cd-* |
| B. | Ab + cd * - |
| C. | Ab + - cd * |
| D. | Ab cd + - * |
| Answer» B. Ab + cd * - | |
| 42. |
The postfix form of A ^ B * C D + E/ F/ (G + H) |
| A. | AB^C*D-EF/GH+/+ |
| B. | AB^CD-EP/GH+/+* |
| C. | ABCDEFGH+//+-*^ |
| D. | AB^D +EFGH +//*+ |
| Answer» B. AB^CD-EP/GH+/+* | |
| 43. |
The postfix form of the expression (A + B) (C D E) F / G is |
| A. | AB + CD E FG / |
| B. | / AB + CD E F G / |
| C. | AB + CD E F G / |
| D. | AB + CDE F G / |
| Answer» B. / AB + CD E F G / | |
| 44. |
The postfix form of the expression (A+B) (C D-E) F/G is |
| A. | AB+CDE F G/ |
| B. | AB+CD E F G/ |
| C. | AB+CD E F G/ |
| D. | AB+CD E FG/ |
| Answer» E. | |
| 45. |
The postfix form of the following infix notation is : (A + B)* (C*D E)* F |
| A. | AB + CD*E *F* |
| B. | AB+ CDE + * F* |
| C. | AB+ CD EF + ** |
| D. | ABCDEF* + * + |
| Answer» B. AB+ CDE + * F* | |
| 46. |
What is the functionality of the following piece of Java code?Assume: a is a non empty array of integers, the Stack class creates an array of specified size and provides a top pointer indicating TOS(top of stack), push and pop have normal meaning. |
| A. | Print alternate elements of array |
| B. | Duplicate the given array |
| C. | Parentheses matching |
| D. | Reverse the array |
| Answer» E. | |
| 47. |
What is the postfix form of the following prefix:*+ab cd |
| A. | Ab+cd * |
| B. | Abc+* |
| C. | Ab+*cd |
| D. | Ab+*cd |
| Answer» B. Abc+* | |
| 48. |
Array implementation of Stack is not dynamic , which of the following statements supports this argument? |
| A. | Space allocation for array is fixed and cannot be changed during run-time |
| B. | User unable to give the input for stack operations |
| C. | A runtime exception halts execution |
| D. | All of the mentioned |
| Answer» B. User unable to give the input for stack operations | |
| 49. |
is not the operation that can be performed on queue. |
| A. | Insertion |
| B. | Deletion |
| C. | Retrieval |
| D. | Traversal |
| Answer» E. | |
| 50. |
. Is a pile in which items are added at one end and removed from the other. |
| A. | Stack |
| B. | Queue |
| C. | List |
| D. | None of the above |
| Answer» C. List | |