MCQOPTIONS
Saved Bookmarks
This section includes 66 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
Parentheses are simply ignored in the conversion of infix to postfix expression. |
| A. | True |
| B. | False |
| Answer» C. | |
| 52. |
What is the time complexity for converting decimal to binary numbers? |
| A. | O(1) |
| B. | O(n) |
| C. | O(logn) |
| D. | O(nlogn) |
| Answer» D. O(nlogn) | |
| 53. |
What is the other name for a postfix expression? |
| A. | Normal polish Notation |
| B. | Reverse polish Notation |
| C. | Warsaw notation |
| D. | Infix notation |
| Answer» C. Warsaw notation | |
| 54. |
What is the result of the following postfix expression? ab*cd*+ where a=2,b=2,c=3,d=4. |
| A. | 16 |
| B. | 12 |
| C. | 14 |
| D. | 10 |
| Answer» B. 12 | |
| 55. |
Which of the following is valid reverse polish expression? |
| A. | a op b |
| B. | op a b |
| C. | a b op |
| D. | both op a b and a b op |
| Answer» D. both op a b and a b op | |
| 56. |
Out of the following operators (^, *, +, &, $), the one having highest priority is _________ |
| A. | + |
| B. | $ |
| C. | ^ |
| D. | & |
| Answer» D. & | |
| 57. |
Evaluate the following infix expression using algorithm and choose the correct answer. a+b*c-d/e^f where a=1, b=2, c=3, d=4, e=2, f=2. |
| A. | 6 |
| B. | 8 |
| C. | 9 |
| D. | 7 |
| Answer» B. 8 | |
| 58. |
Out of the following operators (|, *, +, &, $), the one having lowest priority is ________ |
| A. | + |
| B. | $ |
| C. | | |
| D. | & |
| Answer» C. | | |
| 59. |
To convert the postfix expression into the infix expression we use stack and scan the postfix expression from left to right. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 60. |
Given a prefix and a postfix notation what are the difference between them? |
| A. | The postfix equation is solved starting from the left whereas the prefix notation is solved from the right |
| B. | The postfix equation is solved starting from the right whereas the prefix notation is solved from the left |
| C. | Both equations are solved starting from the same side(right) |
| D. | Both equations are solved starting from the same side(left) |
| Answer» B. The postfix equation is solved starting from the right whereas the prefix notation is solved from the left | |
| 61. |
Which of these operators have the highest order of precedence? |
| A. | '(' and ')' |
| B. | '*' and '/' |
| C. | '~' and '^' |
| D. | '+' and '-' |
| Answer» D. '+' and '-' | |
| 62. |
What is the result of the given postfix expression? abc*+ where a=1, b=2, c=3. |
| A. | 4 |
| B. | 5 |
| C. | 6 |
| D. | 7 |
| Answer» E. | |
| 63. |
When an operand is read, which of the following is done? |
| A. | It is placed on to the output |
| B. | It is placed in operator stack |
| C. | It is ignored |
| D. | Operator stack is emptied |
| Answer» B. It is placed in operator stack | |
| 64. |
While evaluating a prefix expression, the string is read from? |
| A. | left to right |
| B. | right to left |
| C. | center to right |
| D. | center to left to right |
| Answer» C. center to right | |
| 65. |
Which of the following statement is incorrect with respect to balancing symbols algorithm? |
| A. | {[()]} |
| B. | ([ )] |
| C. | {( )} |
| D. | { [ ] } |
| Answer» C. {( )} | |
| 66. |
What is the time complexity of an infix to postfix conversion algorithm? |
| A. | O(N log N) |
| B. | O(N) |
| C. | O(N2) |
| D. | O(M log N) |
| Answer» C. O(N2) | |