Question 46
Which data structure is commonly used to check balanced parentheses in an expression?
Opening brackets are pushed. When a closing bracket appears, the most recent unmatched opening bracket is popped and checked for a matching type.
Which data structure is commonly used to check balanced parentheses in an expression?
Opening brackets are pushed. When a closing bracket appears, the most recent unmatched opening bracket is popped and checked for a matching type.
What is the time complexity of inserting an element at the rear of a queue implemented with a circular array, when rear is maintained?
The rear index is advanced using modular arithmetic and the new item is written into that slot. No shifting is needed.
Which queue variant removes elements according to priority rather than arrival order?
A priority queue selects the element with the highest or lowest priority according to its ordering rule, rather than strict FIFO order.
What is the maximum number of children a node can have in a binary tree?
The defining property of a binary tree is that each node has at most two children, conventionally called left and right.
A binary tree in which every level except possibly the last is completely filled, and the last is filled from left to right, is called:
A complete binary tree fills levels in order and places any nodes on the final level as far left as possible.