Data Structures and Algorithms Online Test - 1

Question: 1

Name the tree in which, for every node, the height of left sub tree and height of right sub tree can differ by at most one

(A) AVL tree

(B) B-tree

(C) Threaded tree

(D) Complete tree

Ans: A

AVL tree

Question: 2

Which of the following statements about a binary tree is correct?

(A) No binary tree is both complete and full

(B) Every full binary tree is also a complete binary tree

(C) Every complete binary tree is also a full binary tree

(D) Every binary tree is either complete or full

Ans: B

Every full binary tree is also a complete binary tree

Question: 3

What is the worst-case time for binary search finding a single item in an array?

(A) Quadratic time

(B) Linear time

(C) Logarithmic time

(D) Constant time

Ans: C

Logarithmic time

Question: 4

If a binary tree satisfies shape and order property, it is known as

(A) Rooted tree

(B) Heap

(C) Sequential search tree

(D) Binary search tree

Ans: B

Heap

Question: 5

With an array-based stack, the algorithm for push is

(A) Increment top and add item to the new top location

(B) Add item to the top location and then increment top

(C) Return the top item and increment top

(D) Return the top item and decrement top

Ans: A

Increment top and add item to the new top location

Related Questions