Exam 17: Tree Structures

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

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

(Multiple Choice)
4.8/5
(39)

If a min-heap has 1024 nodes, what is its height?

(Multiple Choice)
4.9/5
(35)

Consider the following binary search tree diagram: Consider the following binary search tree diagram:   If node M is to be removed, which action should be taken? If node M is to be removed, which action should be taken?

(Multiple Choice)
4.7/5
(37)

A min-heap is a binary tree structure in which missing nodes may only occur where?

(Multiple Choice)
4.9/5
(32)

You are using a tree to show the evaluation order of arithmetic expressions. Which of the following statements is NOT correct?

(Multiple Choice)
4.8/5
(30)

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

What is the efficiency of the heapsort algorithm?

(Multiple Choice)
4.9/5
(37)

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

(Multiple Choice)
4.8/5
(35)

Which of the following sequences of insertions will result in a balanced tree? 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.8/5
(39)

What does the left node reference of a newly inserted binary search tree node get set to?

(Multiple Choice)
4.8/5
(39)

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

(Multiple Choice)
4.8/5
(39)

Adding an element to a balanced binary search tree takes ____ time.

(Multiple Choice)
4.7/5
(39)

Consider the following binary search tree: Consider the following binary search tree:   Which of the following sequences correctly represents breadth-first traversal of this tree? Which of the following sequences correctly represents breadth-first traversal of this tree?

(Multiple Choice)
4.9/5
(32)

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

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.8/5
(42)

As implemented in the textbook, a tree class contains which of the following? I Node class II Root node III List of child nodes

(Multiple Choice)
4.7/5
(46)

When we map a min-heap with n elements to an array with n + 1 elements, the right child of the root is stored at which array index?

(Multiple Choice)
4.8/5
(45)

Consider the following binary search tree diagram: Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element B?  Which of the following trees represents the correct result after inserting element B? Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element B?

(Multiple Choice)
4.9/5
(34)

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

Given the BinaryTree class discussed in section 17.2 (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. public class BinaryTree { Private Node root; Public BinaryTree() { Root = null; } Public BinaryTree(Object rootData, BinaryTree left, BinaryTree right) { Root = new Node(); Root.data = rootData; Root.left = left.root; Root.right = right.root; } Class Node { Public Object data; Public Node left; Public Node right; } Public Object rightMostValue() { If (root == null) { Return null; } Else { Return rightMostValue(root); } } Public static Object rightMostValue(Node n) { If (n.right == null) { Return n.data; } Else { Return ______________________; } } }

(Multiple Choice)
4.7/5
(47)
Showing 41 - 60 of 110
close modal

Filters

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