The data structure required to check whether an expression contains balanced parenthesis is?
A.
Stack
B.
Queue
C.
Array
D.
Tree
Answer: Option A
Explanation:
The stack is a simple data structure in which elements are added and removed based on the LIFO principle. Open parenthesis is pushed into the stack and a closed parenthesis pops out elements till t
What data structure would you mostly likely see in a non recursive implementation of a recursive algorithm ?
A.
Linked List
B.
Stack
C.
Queue
D.
Tree
Answer: Option B
Explanation:
In recursive algorithms, the order in which the recursive process comes back is the reverse of the order in which it goes forward during execution. The compiler uses the stack data structure to implement recursion. In the forwarding phase, the values of local variables, parameters and the return address are pushed into the stack at each recursion level. In the backing-out phase, the stacked address is popped and used to execute the rest of the code.
The process of accessing data stored in a serial access memory is similar to manipulating data on a ?
A.
Heap
B.
Binary Tree
C.
Array
D.
Stack
Answer: Option D
Explanation:
In serial access memory data records are stored one after the other in which they are created and are accessed sequentially. In stack data structure, elements are accessed sequentially. Stack data structure resembles the serial access memory.