Exam 17: Tree Structures

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

What is the complexity of adding an element to a heap?

(Multiple Choice)
4.9/5
(39)

Which of the following statements about balanced trees is NOT correct?

(Multiple Choice)
4.8/5
(31)

Consider the following Huffman encoding tree: Consider the following Huffman encoding tree:   The letter H will be encoded as ____. The letter H will be encoded as ____.

(Multiple Choice)
4.9/5
(38)

Given the BinaryTree class (partially shown below), select an expression to complete the static recursive helper method countLeaves, which returns the number of leaf nodes in the binary tree rooted at node n. Given the BinaryTree class (partially shown below), select an expression to complete the static recursive helper method countLeaves, which returns the number of leaf nodes in the binary tree rooted at node n.

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.8/5
(43)

Consider the following tree diagram: Consider the following tree diagram:   Which of the following is a path in the tree? Which of the following is a path in the tree?

(Multiple Choice)
4.8/5
(34)

Consider the following tree diagrams: Consider the following tree diagrams:   Which of the above are binary search trees? Which of the above are binary search trees?

(Multiple Choice)
4.8/5
(37)

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.9/5
(42)

What is the complexity of removing an element from a heap?

(Multiple Choice)
4.8/5
(28)

Given the Node class (partially shown below), select a statement to complete the recursive method descendants, which is designed to return the number of descendants of a node. Given the Node class (partially shown below), select a statement to complete the recursive method descendants, which is designed to return the number of descendants of a node.

(Multiple Choice)
4.8/5
(25)

Consider the following tree diagram: Consider the following tree diagram:   Which of the following is NOT a path starting with the node P in the tree? Which of the following is NOT a path starting with the node P in the tree?

(Multiple Choice)
4.8/5
(43)

Consider the following tree diagrams: Consider the following tree diagrams:   Which of these trees is considered to be unbalanced? Which of these trees is considered to be unbalanced?

(Multiple Choice)
4.7/5
(38)

If a min-heap has 14 nodes, what is known for certain when we add a new node? i.every level of the tree will be fully occupied II.the tree does not grow a new level III.the root contains the smallest element

(Multiple Choice)
4.9/5
(40)

Given the BinaryTree class (partially shown below), select an expression to complete the static recursive helper method rightMostValue, which is designed to return the data value in the rightmost node of the tree rooted at node n. Given the BinaryTree class (partially shown below), select an expression to complete the static recursive helper method rightMostValue, which is designed to return the data value in the rightmost node of the tree rooted at node n.

(Multiple Choice)
4.9/5
(32)

You wish to traverse a binary search tree in sorted order.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.9/5
(32)

Consider the following addNode method for inserting a newNode into a binary search tree: Consider the following addNode method for inserting a newNode into a binary search tree:   Which of the following sequences of insertions will result in a balanced tree? In each sequence, the first node inserted becomes the root of the tree on which the addNode method is called for the subsequent insertions. i.12, 7, 25, 6, 9, 13, 44 II.12, 7, 25, 44, 13, 6, 9 III.12, 25, 44, 13, 6, 9, 7 Which of the following sequences of insertions will result in a balanced tree? In each sequence, the first node inserted becomes the root of the tree on which the addNode method is called for the subsequent insertions. i.12, 7, 25, 6, 9, 13, 44 II.12, 7, 25, 44, 13, 6, 9 III.12, 25, 44, 13, 6, 9, 7

(Multiple Choice)
4.9/5
(27)

Locating an element in a balanced binary search tree takes ____ time.

(Multiple Choice)
4.9/5
(30)

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.9/5
(38)

Which of the following statements about removing a node from a red-black tree is correct?

(Multiple Choice)
4.9/5
(42)

The height h of a completely filled binary tree with n nodes is ____.

(Multiple Choice)
4.9/5
(33)
Showing 41 - 60 of 102
close modal

Filters

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