×

Multiple-Choice Questions

Which of the following data structures can be used to check if an expression has matching parenthesis or not?

21. Which of the following data structures can be used to check if an expression has matching parenthesis or not?

  1. Tree
  2. Queue
  3. Stack
  4. Linkedlist

Answer

The correct answer is: C) Stack

Explanation

Stack. As stack is using the LIFO (Last In First Out) approach, it is best suited to find matching parenthesis.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.