Applications MCQ Quiz - Objective Question with Answer for Applications - Download Free PDF

Last updated on Apr 14, 2025

Latest Applications MCQ Objective Questions

Applications Question 1:

The postfix equivalent of the infix expression (a + b)*(c*d - e) * f/g is :

  1. ab + cd*e - fg*/*
  2. ab cd*e - fg/** 
  3. ab cde* - fg/**
  4. abcd e*fg - /**

Answer (Detailed Solution Below)

Option 1 : ab + cd*e - fg*/*

Applications Question 1 Detailed Solution

The correct answer is ab + cd*e - fg*/*.

key-point-imageKey Points

  • To convert an infix expression to its postfix equivalent, follow the order of operations and use a stack to manage the operators.
  • The given infix expression is (a + b)*(c*d - e) * f/g.
    • First, evaluate the expression inside the parentheses: a + b and c*d - e.
    • The postfix notation for a + b is ab+.
    • The postfix notation for c*d - e is cd*e-.
    • Next, multiply the results of these two expressions: (ab+)(cd*e-).
    • The postfix notation for this multiplication is ab+cd*e-*.
    • Finally, multiply by f and divide by g: (ab+cd*e-)*f/g.
    • The postfix notation for this final expression is ab+cd*e-*f*g/.
  • Therefore, the postfix equivalent of the infix expression (a + b)*(c*d - e) * f/g is ab+cd*e-*f*g/.

additional-information-imageAdditional Information

  • Infix notation is the standard arithmetic and logical formula notation, where operators are placed between operands (e.g., a + b).
  • Postfix notation (also known as Reverse Polish Notation) places operators after their operands (e.g., ab+).
  • Postfix notation eliminates the need for parentheses to define operation order.
  • This method is particularly useful in computer science for evaluating expressions in a stack-based manner.

Applications Question 2:

Evaluate the following postfix expression and find the correct value in the following- 50, 60, +, 20, 10, -, *

  1. 1100
  2. 1000
  3. 9000
  4. 10

Answer (Detailed Solution Below)

Option 1 : 1100

Applications Question 2 Detailed Solution

The correct answer is 1100.

Key Points

  • To evaluate a postfix expression, follow these steps:
    • Read the expression from left to right.
    • Push operands onto a stack.
    • When an operator is encountered, pop the required number of operands from the stack, perform the operation, and push the result back onto the stack.
  • Let's evaluate the given postfix expression step-by-step: 50, 60, +, 20, 10, -, *
    • Push 50 onto the stack.
    • Push 60 onto the stack.
    • Encounter '+', pop 60 and 50, add them (50 + 60 = 110), push 110 onto the stack.
    • Push 20 onto the stack.
    • Push 10 onto the stack.
    • Encounter '-', pop 10 and 20, subtract them (20 - 10 = 10), push 10 onto the stack.
    • Encounter '*', pop 10 and 110, multiply them (110 * 10 = 1100), push 1100 onto the stack.
  • After processing all elements, the final value on the stack is 1100, which is the result of the postfix expression.

Additional Information

  • Postfix expressions, also known as Reverse Polish Notation (RPN), do not require parentheses to dictate operation precedence.
  • They are often used in computer science because they can be easily evaluated using a stack, which simplifies the parsing process.
  • Postfix notation is particularly useful in situations where the order of operations needs to be explicitly defined and consistently followed.
  • Commonly used in stack-based and expression evaluation algorithms in compilers and calculators.

Applications Question 3:

Which is true for "x in y" membership operator expression used in Python?

  1. Returns true if a sequence with the specified value is not present in the object
  2. Returns true if both variables are not the same object
  3. Returns true if both variables are the same object
  4. Returns true if a sequence with the specified value is present in the object
  5. None of the above

Answer (Detailed Solution Below)

Option 4 : Returns true if a sequence with the specified value is present in the object

Applications Question 3 Detailed Solution

The correct answer is: Returns true if a sequence with the specified value is present in the object

 Key Points

  • In Python, "x in y" is a membership operator that checks if a sequence (like a list or a string) with the specified value (x) is present in the object (y).
  • If the sequence is present, it returns True; otherwise, it returns False. The other options are not related to the "in" operator in Python.

Applications Question 4:

Which is true for "x in y" membership operator expression used in Python?

  1. Returns true if a sequence with the specified value is not present in the object
  2. Returns true if both variables are not the same object
  3. Returns true if both variables are the same object
  4. Returns true if a sequence with the specified value is present in the object

Answer (Detailed Solution Below)

Option 4 : Returns true if a sequence with the specified value is present in the object

Applications Question 4 Detailed Solution

The correct answer is: Returns true if a sequence with the specified value is present in the object

 Key Points

  • In Python, "x in y" is a membership operator that checks if a sequence (like a list or a string) with the specified value (x) is present in the object (y).
  • If the sequence is present, it returns True; otherwise, it returns False. The other options are not related to the "in" operator in Python.

Applications Question 5:

_______ to evaluate an expression without any embedded function calls.

  1. Two stacks are required
  2. One stack is needed
  3. Three stacks are required
  4. More than three stacks are required
  5. None of the above/More than one of the above

Answer (Detailed Solution Below)

Option 2 : One stack is needed

Applications Question 5 Detailed Solution

Concept:

Stack is an abstract data type which follows an order LIFO (last in first out) to evaluate any expression.

Element that is inserted at the last into the stack will be the first to get out of the stack.

Application of the stack:

1) Converting infix to postfix/prefix expression

2) parenthesis matching

3) Expression evaluation etc.

Explanation:

Only one stack is enough to evaluate any expression or to convert one form to other form of expression.

Suppose we have a post fix expression: 15 3 * 10 – 5 /

For evaluating this:

1) Push 15 in the stack, push 3 in the stack

2) when * operator comes, pop 15 and 3 from the stack

3) Push 15 * 3 = 45 in the stack

4) push 10 in the stack

5) when – operator occurs, pop 45 and 10 from the stack

6) push 45 – 10 = 35 in the stack

7) push 5 in the stack

8) when / operator comes, pop 35 and 5 from the stack

9) Push 35 / 5 = 7 in the stack

So, we get the answer using only one stack. One stack is enough to evaluate any expression without any embedded function call.

Top Applications MCQ Objective Questions

What is the postfix representation of the following infix expression?

(A + B) * C – D * E / F

  1. A B + C * D E * F - /
  2. A B * C + D E * F / -
  3. A B + C – D E * F / *
  4. A B + C * D E * F / -

Answer (Detailed Solution Below)

Option 4 : A B + C * D E * F / -

Applications Question 6 Detailed Solution

Download Solution PDF

Concept:

() has highest precedence

* and / has same precedence while + and – has same precedence

(* and /) and higher precedence than (+, -)

Associativity is left to right:

Explanation:

(A + B) * C – D * E / F

A B + * C – D * E / F

A B + C * – D * E / F

A B + C * D E * / F

A B + C * D E * F /

A B + C * D E * F / –

Consider the following postfix expression with single digit operands:

6 2 3 * / 4 2 * + 6 8 * -

The top two elements of the stack after second * is evaluated, are:

  1. 6, 3
  2. 8, 1
  3. 8, 2
  4. 6, 2

Answer (Detailed Solution Below)

Option 2 : 8, 1

Applications Question 7 Detailed Solution

Download Solution PDF

Postfix expression: 6 2 3 * / 4 2 * + 6 8 * -

F2 R.S. Nita 04.10.2019 D 10

F2 R.S. Nita 04.10.2019 D 11,ong

A stack is implemented with an array of ‘A [0..N – 1]’ and a variable ‘pos’. The push and pop operations are defined by the following code.

push(x)

                A[pos] ← x

                pos ← pos – 1

end push

pop( )

                pos ← pos + 1

                return A[pos]

end pop

Which of the following will initialize an empty stack with capacity N for the above implementation?

  1. pos ← -1
  2. pos ← 0
  3. pos ← 1
  4. pos ← N - 1

Answer (Detailed Solution Below)

Option 4 : pos ← N - 1

Applications Question 8 Detailed Solution

Download Solution PDF

Concept:

Usually, the empty stack is initialized with value 0 and this value increments by 1 every time we push an element on to the stack.

The code for such a stack looks like this,

push (x)

                A[pos] ← x

                pos ← pos + 1 /the initial value is incremented by 1 as element is pushed onto the stack

end push

However, in the question, when push operation takes place, the value of variable is decremented by 1 (pos – 1).  Hence, initial value of pos will have to be N-1.

Explanation

For example, if we take an array with N = 4 to represent our stack. It will be A [0, 1, 2, 3].

Now, in order to push four elements, say x, y, z, w

  • First we will push at x index 3 which is 4 – 1
  • Then, we will decrement pos and push y at index 2 and so on.

Note that, the pop operation is also behaving inversely here.

  • In usual stack, pop would decrement value of pos.

In our case, pop is incrementing the value of pos.

For implementation of recursion system uses _______ data structure.

  1. Stack
  2. Linked List
  3. Deque
  4. Queue

Answer (Detailed Solution Below)

Option 1 : Stack

Applications Question 9 Detailed Solution

Download Solution PDF

Concept:

Stack properties:

  • Because of LIFO property it remembers it’s caller so knows whom to return when the function has to return.
  • Recursion makes use of system for storing the return addresses of the function calls.


Explanation:

So we need stack to implement recursion and we use stack in case of function calling as well.

Some more application of stack:

  1. Used to evaluate prefix, postfix and infix expressions.
  2. To convert one expression to another etc


Hence option 1 is the correct answer.

The postfix equivalent of the infix expression (a + b)*(c*d - e) * f/g is :

  1. ab + cd*e - fg*/*
  2. ab cd*e - fg/** 
  3. ab cde* - fg/**
  4. abcd e*fg - /**

Answer (Detailed Solution Below)

Option 1 : ab + cd*e - fg*/*

Applications Question 10 Detailed Solution

Download Solution PDF

The correct answer is ab + cd*e - fg*/*.

key-point-imageKey Points

  • To convert an infix expression to its postfix equivalent, follow the order of operations and use a stack to manage the operators.
  • The given infix expression is (a + b)*(c*d - e) * f/g.
    • First, evaluate the expression inside the parentheses: a + b and c*d - e.
    • The postfix notation for a + b is ab+.
    • The postfix notation for c*d - e is cd*e-.
    • Next, multiply the results of these two expressions: (ab+)(cd*e-).
    • The postfix notation for this multiplication is ab+cd*e-*.
    • Finally, multiply by f and divide by g: (ab+cd*e-)*f/g.
    • The postfix notation for this final expression is ab+cd*e-*f*g/.
  • Therefore, the postfix equivalent of the infix expression (a + b)*(c*d - e) * f/g is ab+cd*e-*f*g/.

additional-information-imageAdditional Information

  • Infix notation is the standard arithmetic and logical formula notation, where operators are placed between operands (e.g., a + b).
  • Postfix notation (also known as Reverse Polish Notation) places operators after their operands (e.g., ab+).
  • Postfix notation eliminates the need for parentheses to define operation order.
  • This method is particularly useful in computer science for evaluating expressions in a stack-based manner.

_________ is First in Last Out kind of data structure.

  1. Queue
  2. Array
  3. Deque
  4. Stack

Answer (Detailed Solution Below)

Option 4 : Stack

Applications Question 11 Detailed Solution

Download Solution PDF
  • Stack is data structure which is Last in First Out (LIFO) or First in Last Out (FILO) which means the element which is popped last from stack is pushed first in stack, or element which is pushed first in stack is popped last from stack
  • Queue is data structure which is First in First Out (FIFO) or Last in Last Out (LILO)

Applications Question 12:

What is the postfix representation of the following infix expression?

(A + B) * C – D * E / F

  1. A B + C * D E * F - /
  2. A B * C + D E * F / -
  3. A B + C – D E * F / *
  4. A B + C * D E * F / -

Answer (Detailed Solution Below)

Option 4 : A B + C * D E * F / -

Applications Question 12 Detailed Solution

Concept:

() has highest precedence

* and / has same precedence while + and – has same precedence

(* and /) and higher precedence than (+, -)

Associativity is left to right:

Explanation:

(A + B) * C – D * E / F

A B + * C – D * E / F

A B + C * – D * E / F

A B + C * D E * / F

A B + C * D E * F /

A B + C * D E * F / –

Applications Question 13:

Consider the following postfix expression with single digit operands:

6 2 3 * / 4 2 * + 6 8 * -

The top two elements of the stack after second * is evaluated, are:

  1. 6, 3
  2. 8, 1
  3. 8, 2
  4. 6, 2

Answer (Detailed Solution Below)

Option 2 : 8, 1

Applications Question 13 Detailed Solution

Postfix expression: 6 2 3 * / 4 2 * + 6 8 * -

F2 R.S. Nita 04.10.2019 D 10

F2 R.S. Nita 04.10.2019 D 11,ong

Applications Question 14:

A stack is implemented with an array of ‘A [0..N – 1]’ and a variable ‘pos’. The push and pop operations are defined by the following code.

push(x)

                A[pos] ← x

                pos ← pos – 1

end push

pop( )

                pos ← pos + 1

                return A[pos]

end pop

Which of the following will initialize an empty stack with capacity N for the above implementation?

  1. pos ← -1
  2. pos ← 0
  3. pos ← 1
  4. pos ← N - 1

Answer (Detailed Solution Below)

Option 4 : pos ← N - 1

Applications Question 14 Detailed Solution

Concept:

Usually, the empty stack is initialized with value 0 and this value increments by 1 every time we push an element on to the stack.

The code for such a stack looks like this,

push (x)

                A[pos] ← x

                pos ← pos + 1 /the initial value is incremented by 1 as element is pushed onto the stack

end push

However, in the question, when push operation takes place, the value of variable is decremented by 1 (pos – 1).  Hence, initial value of pos will have to be N-1.

Explanation

For example, if we take an array with N = 4 to represent our stack. It will be A [0, 1, 2, 3].

Now, in order to push four elements, say x, y, z, w

  • First we will push at x index 3 which is 4 – 1
  • Then, we will decrement pos and push y at index 2 and so on.

Note that, the pop operation is also behaving inversely here.

  • In usual stack, pop would decrement value of pos.

In our case, pop is incrementing the value of pos.

Applications Question 15:

Evaluate the following postfix expression:

2 5 + 7 / 3 * 9 +

  1. 12
  2. 2
  3. 14
  4. 9

Answer (Detailed Solution Below)

Option 1 : 12

Applications Question 15 Detailed Solution

The correct answer is option 1 i.e. 12.

Expression Stack
2 2
5 2 5
+ 7
7 7 7
/ 1
3 1 3
* 3
9 3 9
+ 12
Get Free Access Now
Hot Links: teen patti master old version teen patti circle teen patti club master teen patti