Exam 17: Tree Structures

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

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 visit order for an inorder traversal of the same binary tree?

(Multiple Choice)
4.7/5
(35)

A completely filled binary tree with a height of 4 has ____ nodes.

(Multiple Choice)
4.8/5
(30)

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

(Multiple Choice)
4.9/5
(28)

If the postorder traversal of an expression tree is 8, 2, +, 5, /, what is the preorder traversal?

(Multiple Choice)
4.8/5
(40)

If the postorder traversal of an expression tree is, 8, 2, +, 5, /, what is the result of an inorder traversal?

(Multiple Choice)
4.9/5
(33)

Consider the following tree diagram: Consider the following tree diagram:   Which of the following statements is NOT correct? Which of the following statements is NOT correct?

(Multiple Choice)
4.9/5
(40)

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

(Multiple Choice)
4.8/5
(27)

You wish to traverse a binary search tree using postorder 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.7/5
(44)

Given the BinarySearchTree class discussed in section 17.3, select a statement to complete the following code segment, so that the resulting binary search tree has a height of 4. BinarySearchTree t = new BinarySearchTree(); t.add("a"); t.add("day"); t.add("in"); __________________ t.add("life");

(Multiple Choice)
4.9/5
(40)

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

(Multiple Choice)
4.7/5
(37)

Consider the following tree diagram: Consider the following tree diagram:   Which of the following statements is NOT correct? Which of the following statements is NOT correct?

(Multiple Choice)
4.8/5
(38)

Which of the following statements about a heap is NOT correct?

(Multiple Choice)
4.8/5
(41)

If a min-heap has 15 nodes, what is known for certain? I every level of the tree is fully occupied II at least one level is missing a node III the root contains the smallest element

(Multiple Choice)
4.9/5
(35)

A binary search tree is made up of a collection of nodes organized with smaller data values on the left and greater values on the right relative to any node. Which of the following Node references must be instance variables of any implementation of a Node class? I root II left III right

(Multiple Choice)
4.7/5
(40)

Consider the following binary search tree diagram: Consider the following binary search tree diagram:   Which nodes will be visited in order to insert the letter E into this tree? Which nodes will be visited in order to insert the letter E into this tree?

(Multiple Choice)
4.9/5
(43)

How many times during the heapsort algorithm does the fixHeap method need to be called for a max-heap with n elements?

(Multiple Choice)
4.9/5
(40)

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)
5.0/5
(36)

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

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

(Multiple Choice)
4.9/5
(35)

When we map a min-heap with n elements to an array with n + 1 elements, we ignore array element 0, and place the root value at which array index?

(Multiple Choice)
4.9/5
(34)
Showing 61 - 80 of 110
close modal

Filters

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