View Assessment Result: Multiple Choice Quiz 10



Your performance was as follows:

1.
A node in a tree that does not have a predecessor is called

(a) an internal node
(b) a root
(c) a leaf
(d) a parent node

Correct answer is (b)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (b) No Feedback



2.
A node in a tree that does not have any children is called

(a) an empty node
(b) a leaf
(c) an internal node
(d) a root

Correct answer is (b)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (b) No Feedback



3.
Which of the following is true about the total number of nodes in a tree with depth 2?

(a) There is no bound on the number of nodes.
(b) It is at most 2.
(c) It is at most 1.
(d) It is at most 3.

Correct answer is (a)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (a) No Feedback



4.
A full node in a binary tree has how many children?

(a) 0
(b) 1 or 2
(c) 1
(d) 2

Correct answer is (d)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (d) No Feedback



5.
In the standard array implementation of a binary tree the nodes are stored in an array. What is the convention for the array position of the parent of the node in position p of the array?

(a) p - 1
(b) p/2
(c) 2 * p
(d) 2 * p + 1

Correct answer is (b)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (b) No Feedback



6.
In the standard array implementation of a binary tree, the nodes are stored in an array. What is the convention for the array position of the left child of the node in position p of the array?

(a) 2 * p + 1
(b) p + 1
(c) p/2
(d) 2 * p

Correct answer is (d)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (d) No Feedback



7.

Consider the following pseudo-code, which indicates part of a standard binary tree algorithm.

      print( node )
      {
      print  data;
      if( there is a left child )  print( left child );
      if( there is a right child )  print( right child );
      }

Which of the following is the standard name for this algorithm?



(a) Preorder traversal
(b) Binary search
(c) Inorder traversal
(d) Postorder traversal

Correct answer is (a)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (a) No Feedback



8.
A tree can be implemented as a graph whose vertices are the nodes of the tree and where an edge (u,v) indicates that u is the parent of v. Which of the following indicates all the nodes of such an implementation that are reachable by a depth first search starting at the root?

(a) Only the leaves of the tree
(b) Only the nodes in the left subtree of the root
(c) Only the interior nodes of the tree
(d) All nodes in the tree

Correct answer is (d)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (d) No Feedback



9.
During a failed search for an element in a completely balanced binary search tree of size 1,000,000, approximately how many nodes of the tree is visited?

(a) 1000
(b) 20
(c) 10,000
(d) 200

Correct answer is (b)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (b) No Feedback



10.
If numbers 1,2,...,n are inserted into a binary search tree in random order, then the result for large n is a

(a) tree where all nodes are full
(b) reasonably balanced tree
(c) completely balanced tree
(d) totally unbalanced tree

Correct answer is (b)

Your score on this question is: 10.00

Feedback:
   See section 2.3.1 of the course notes.
   (b) No Feedback



Go to top of assessment.

Total score: 100.00