Exam 17: Tree Structures

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

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

(Multiple Choice)
4.8/5
(44)

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

(Multiple Choice)
4.8/5
(44)

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

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 E 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 E into this tree, calling addNode on the root of the tree?

(Multiple Choice)
4.8/5
(40)

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

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

(Multiple Choice)
4.8/5
(41)

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
(28)

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

(Multiple Choice)
4.8/5
(40)

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

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

Which of the following statements about trees is NOT correct?

(Multiple Choice)
4.8/5
(34)

Consider the following tree diagram: Consider the following tree diagram:   Which arithmetic expression is represented by this tree? Which arithmetic expression is represented by this tree?

(Multiple Choice)
4.8/5
(38)

A balanced binary tree with 260 nodes has a height of approximately ____.

(Multiple Choice)
4.9/5
(33)

If both of the child references of a binary tree node are non-null, it follows that the node must be ____.

(Multiple Choice)
4.8/5
(27)

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

Adding an element to an unbalanced binary search tree takes ____ time.

(Multiple Choice)
4.8/5
(40)

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
(51)

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

(Multiple Choice)
4.8/5
(49)

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

(Multiple Choice)
4.7/5
(36)

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 Y 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 Y is to be removed, which action should be taken? If node Y is to be removed, which action should be taken?

(Multiple Choice)
4.8/5
(44)
Showing 61 - 80 of 102
close modal

Filters

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