## Objective Questions

*Question*

A solution is said to be efficient if it solves the problem within its resource constraints i.e. hardware and time.

- True
- False

Answer: 1 | Chapter No. 1 |

*Question*

Which one of the following is known as "Last-In, First-Out" or LIFO Data Structure?

- Linked List
- Stack
- Queue
- Tree

Answer: 2 | Chapter No. 5 |

*Question*

Consider the following pseudo code*declare a stack of characters while ( there are more characters in the word to read ) { read a character push the character on the stack } while ( the stack is not empty ) { pop a character off the stack write the character to the screen } *

What is written to the screen for the input "apples"?

- selpa
- selppa
- apples
- aaappppplleess

Answer: 2 | Chapter No. 5 |

*Question*

What will be postfix expression of the following infix expression?*Infix Expression : a+b*c-d*

- ab+c*d-
- abc*+d-
- abc+*d-
- abcd+*-

Answer: 2 | Chapter No. 6 |

*Question*

For compiler, a postfix expression is easier to evaluate than infix expression?

- True
- False

Answer: 1 | Chapter No. 6 |

*Question*

_________ only removes items in reverse order as they were entered.

- Stack
- Queue
- Both of these
- None of these

Answer: 1 | Chapter No. 8 |

*Question*

A binary tree of N nodes has _____________ .

- Log10 N levels
- Log2 N levels
- N / 2 levels
- N x 2 levels

Answer: 2 | Chapter No. 11 |

*Question*

Consider the following function:*void test_a(int n){cout << n << " ";if (n>0)test_a(n-2);}*

What is printed by the call test_a(4)?

- 4 2 0
- 0 2 4
- 0 2
- 2 4

Answer: 1 | Chapter No. 13 |

*Question*

The easiest case of deleting a node from BST is the case in which the node to be deleted _________.

- Is a leaf node
- Has left subtree only
- Has right subtree only
- Has both left and right subtree

Answer: 1 | Chapter No. 15 |

*Question*

Every AVL is ___________.

- Binary Tree
- Complete Binary Tree
- Binary Search Tree
- None of these

Answer: 3 | Chapter No. 19 |

*Question*

Searching an element in an AVL tree takes maximum _______ time (where n is no. of nodes in AVL tree).

- Log2(n+1)
- Log2(n+1) -1
- 1.44 Log2n
- 1.66 Log2n

Answer: 3 | Chapter No. 21 |