Exam 17: Tree Structures

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Removing an element from an unbalanced binary search tree takes ____ time.

(Multiple Choice)
4.9/5
(44)

What is the efficiency of adding an element to a red-black tree?

(Multiple Choice)
5.0/5
(28)

Consider the following tree diagrams: Consider the following tree diagrams:   Which tree represents the arithmetic expression 2 *5 + 4? Which tree represents the arithmetic expression 2 *5 + 4?

(Multiple Choice)
4.7/5
(42)

Which of the following statements about the three tree traversal schemes studied is correct?

(Multiple Choice)
4.8/5
(47)

Consider the following tree diagram: Consider the following tree diagram:   What is the size of the subtree with root R? What is the size of the subtree with root R?

(Multiple Choice)
4.8/5
(40)

Consider the following tree diagram: Consider the following tree diagram:   What is the height of this tree? What is the height of this tree?

(Multiple Choice)
4.8/5
(40)

What is the efficiency of locating an element in a red-black tree?

(Multiple Choice)
4.7/5
(36)

Given the Node class discussed in section 17.1 (partially shown below), select a statement to complete the recursive method descendants, which is designed to return the number of descendants of a node. class Node { Public Object data; Public List<Node> children; ) . . Public int descendants() { Int num = 0; For (Node child : children) { _____________________________ } Return num; } }

(Multiple Choice)
4.9/5
(42)

Consider the following tree diagram: Consider the following tree diagram:   What is the height of the subtree with root R? What is the height of the subtree with root R?

(Multiple Choice)
4.8/5
(36)

You wish to traverse a binary search tree in sorted order using preorder traversal. Arrange the following actions in the correct order to accomplish this. I Print the right subtree recursively II Print the root III Print the left subtree recursively

(Multiple Choice)
4.8/5
(41)

Consider the following tree diagram: Consider the following tree diagram:   Which of the following nodes are leaf nodes? Which of the following nodes are leaf nodes?

(Multiple Choice)
4.8/5
(35)

Insert the missing code in the following code fragment. This fragment is intended to create an iterator to be used to process elements of a tree. TreeSet<String> aTree = . . . String first = iter.next(); String second = iter.next();

(Multiple Choice)
4.8/5
(48)

If the postorder traversal visits the nodes of a binary tree storing character values in the order of U, G, T, R, A, I, what is the value of the root of the tree?

(Multiple Choice)
4.8/5
(32)

Consider the following tree diagram: Consider the following tree diagram:   Which of the following nodes are root nodes? Which of the following nodes are root nodes?

(Multiple Choice)
4.8/5
(41)

Which of the following statements about inserting a node into a red-black tree is NOT correct?

(Multiple Choice)
4.8/5
(27)

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

(Multiple Choice)
4.8/5
(35)

Consider the following tree diagram: Consider the following tree diagram:   What is the size of this tree? What is the size of this tree?

(Multiple Choice)
4.9/5
(38)

Which of the following statements about inserting a node into a red-black tree is correct?

(Multiple Choice)
4.9/5
(36)

Consider the following tree diagram: Consider the following tree diagram:   What is the height of the subtree with root P? What is the height of the subtree with root P?

(Multiple Choice)
4.8/5
(41)

In a binary search tree, where the root node data value = 45, what do we know about the data values of all the descendants in the left subtree of the root?

(Multiple Choice)
4.8/5
(43)
Showing 21 - 40 of 110
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)