Exam 17: Tree Structures

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

If the postorder traversal of an expression tree is 8, 2, +, 5, /, what is the numeric result of that Reverse Polish Notation expression?

(Multiple Choice)
4.8/5
(38)

Which of the following is NOT an example of a binary tree?

(Multiple Choice)
4.7/5
(38)

Insert the missing code in the following code fragment.This fragment is intended to create an iterator and access the first element in a tree. Insert the missing code in the following code fragment.This fragment is intended to create an iterator and access the first element in a tree.

(Multiple Choice)
4.8/5
(41)

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

(Multiple Choice)
4.8/5
(38)

Consider the following binary search tree diagram: Consider the following binary search tree diagram:   Consider the following pseudocode for the removal of a node n in a binary search tree:   If node D is to be removed, which action should be taken? Consider the following pseudocode for the removal of a node n in a binary search tree: Consider the following binary search tree diagram:   Consider the following pseudocode for the removal of a node n in a binary search tree:   If node D is to be removed, which action should be taken? If node D is to be removed, which action should be taken?

(Multiple Choice)
4.7/5
(40)

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

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

(Multiple Choice)
4.8/5
(39)

Consider the following binary search tree diagram: Consider the following binary search tree diagram:   Consider the following addNode method for inserting a newNode into a binary search tree: public void addNode(Node newNode) { int comp = newnode.data.compareTo(data); if (comp < 0) { if (left == null) {left = newNode;} else { left.addNode(newNode); } } else { if (right == null) {right = newNode;} else { right.addNode(newNode); } } } Which nodes will be visited in order to insert the letter B into this tree, calling addNode on the root of the tree? Consider the following addNode method for inserting a newNode into a binary search tree: public void addNode(Node newNode) { int comp = newnode.data.compareTo(data); if (comp < 0) { if (left == null) {left = newNode;} else { left.addNode(newNode); } } else { if (right == null) {right = newNode;} else { right.addNode(newNode); } } } Which nodes will be visited in order to insert the letter B into this tree, calling addNode on the root of the tree?

(Multiple Choice)
4.8/5
(25)

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

(Multiple Choice)
4.9/5
(30)

Consider the following binary search tree diagram: Consider the following binary search tree diagram:   Consider the following pseudocode for the removal of a node n in a binary search tree:      If node J is to be removed, to which node will H point to instead of J? Consider the following pseudocode for the removal of a node n in a binary search tree: Consider the following binary search tree diagram:   Consider the following pseudocode for the removal of a node n in a binary search tree:      If node J is to be removed, to which node will H point to instead of J? If node J is to be removed, to which node will H point to instead of J?

(Multiple Choice)
4.9/5
(34)

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

(Multiple Choice)
4.9/5
(39)

Consider a balanced binary tree with 520 nodes.The average length of all paths from the root to the leaves is approximately ____.

(Multiple Choice)
4.9/5
(36)

Which of the following statements about trees is NOT correct?

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.8/5
(39)

Which of the following statements about a heap is correct?

(Multiple Choice)
4.9/5
(34)

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

(Multiple Choice)
4.8/5
(39)

Which of the following statements about breadth-first and depth-first traversal is NOT correct?

(Multiple Choice)
4.9/5
(45)

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

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

(Multiple Choice)
4.9/5
(39)

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
(32)
Showing 81 - 100 of 102
close modal

Filters

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