Which data structure is required to convert the infix to prefix notation?

2023

Which data structure is required to convert the infix to prefix notation?

  1. A.

    Stack

  2. B.

    Linked list

  3. C.

    Binary tree

  4. D.

    Queue

Attempted by 692 students.

Show answer & explanation

Correct answer: A

Answer: a

Explanation: The answer is a, i.e., stack. Stack is a data structure used to reverse the order of the operators in the expression. It is also used as a storage structure that stores all the operators and print all the operators when all the operands have appeared.

Explore the full course: Amcat Preparation