Reading Quiz 12

Ace your homework & exams now with Quizwiz!

The data in a BST's node's _____ subtree are less than the data in a node's _____ subtree. a) left, right b) right, left c) left, middle d) middle, right

a) left, right

An iterative version of a level order traversal for a binary tree uses a(n) a) queue b) priority queue c) stack d) bag

a) queue

An iterative version of a preorder traversal for a binary tree uses a(n) a) stack b) queue c) priority queue d) queue e) bag

a) stack

The inorder predecessor of a node N is a) the largest entry in N's left subtree b) the largest entry in N's right subtree c) the smallest entry in N's left subtree d) the smallest entry in N's right subtree

a) the largest entry in N's left subtree

What is the worst-case performance of the add method in a full binary search tree with linked nodes? a) O(1) b) O(log n) c) O(n) d) O(n^2)

b) O(log n)

In a binary search tree, the getInorderIterator inherited from the class BinaryTree sorts data a) in descending order b) in ascending order c) in striped order d) none of the above

b) in ascending order

In the interface SearchTreeInterface, what does the method getEntry return if the object being sought doesn't exist? a) throws an exception b) null c) false d) 0

b) null

A complete traversal of an n-node binary tree is a(n) _____ operation if visiting a node is O(1) for the recursive implementation. a) O(1) b) O(log n) c) O(n) d) O(n^2)

c) O(n)

In the interface SearchTreeInterface, what does the method add return if the object being added already exists in the tree? a) throws an exception b) true c) the existing entry that matched the parameter d) 1

c) the existing entry that matched the parameter

The largest entry in a node N's right subtree is a) the right child of N b) the left child of N c) the subtree's rightmost node d) the subtree's leftmost node

c) the subtree's rightmost node

The inorder successor of a node N is a) the largest entry in N's left subtree b) the largest entry in N's right subtree c) the smallest entry in N's left subtree d) the smallest entry in N's right subtree

d) the smallest entry in N's right subtree


Related study sets

Week 2: Designing an Accessible User Experience

View Set

All HW, Quizzes, and Exams from BCMB 311

View Set

Pathophysiology Exam 3 Part 2 #2

View Set

Ch. 6 Physical Exam (Getting Started)

View Set

Study For Patho # 2 Several, Chapter 28 Alterations of Pulmonary functions in children mid, Pathophysiology Ch. 27 Alterations of Pulmonary Function mid, Chapter 26 Structure and function of pulmonary system, Chapter 26: Structure/function of the Pul...

View Set