Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

can you please help me to complete this multiplechoice. QUESTION 1 \"Given a bin

ID: 3689611 • Letter: C

Question

can you please help me to complete this multiplechoice.

QUESTION 1
"Given a binary search tree with n nodes and height h, what is the maximum number of comparisons that each operation requires for the method remove?"

   a)   O(h)

   b)   O(n)

   c)   O(log h)

   d)   O(1)
QUESTION 2
"Given a binary search tree with n nodes and height h, what is the maximum number of comparisons that each operation requires for the method add?"

   a)   O(log h)

   b)   O(n)

   c)   O(h)

   d)   O(1)
QUESTION 3
The inorder successor of a node N is

   a)   the smallest entry in N s left subtree

   b)   the largest entry in N s right subtree

   c)   the smallest entry in N s right subtree

   d)   the largest entry in N s left subtree
QUESTION 4
The largest entry in a node N s right subtree is

   a)   the subtree s leftmost node

   b)   the left child of N

   c)   the right child of N

   d)   the subtree s rightmost node
QUESTION 5
What is the worst-case performance of the getEntry method in a binary search tree with linked nodes?

   a)   O(1)

   b)   O(log n)

   c)   O(n^2)

   d)   O(n)
QUESTION 6
The smallest entry in a node N s left subtree is

   a)   the subtree s rightmost node

   b)   the left child of N

   c)   the subtree s leftmost node

   d)   the right child of N

QUESTION 7
"In the interface SearchTreeInterface, what does the method add return if the object being added already exists in the tree?"

   a)   TRUE

   b)   the existing entry that matched the parameter

   c)   1

   d)   throws an exception
QUESTION 8
"Given a binary search tree with n nodes and height h, what is the maximum number of comparisons that each operation requires for the method getEntry?"

   a)   O(h)

   b)   O(n)

   c)   O(log h)

   d)   O(1)
QUESTION 9
"In the interface SearchTreeInterface, what does the method getEntry return if the object being sought doesn t exist?"

   a)   null

   b)   FALSE

   c)   0

   d)   throws an exception
QUESTION 10
The maximum possible height of a binary search tree with n nodes is

   a)   n

   b)   log n

   c)   n^2

   d)   n-1
QUESTION 11
The smallest entry in a node N s right subtree is

   a)   the subtree s leftmost node

   b)   the subtree s rightmost node

   c)   the left child of N

   d)   the right child of N
QUESTION 12
The data in a node s _____ subtree are less than the data in a node s _____ subtree.

   a)   "right, left"

   b)   "left, middle"

   c)   "left, right "

   d)   "middle, right"
QUESTION 13
The largest entry in a node N s left subtree is

   a)   the subtree s leftmost node

   b)   the left child of N

   c)   the right child of N

   d)   the subtree s rightmost node
QUESTION 14
"In a binary search tree, the getInorderIterator inherited from the class BinaryTree sorts data"

   a)   in ascending order

   b)   in descending order

   c)   in striped order

   d)   none of the above
QUESTION 15
What is the worst-case performance of the remove method in a binary search tree with linked nodes?

   a)   O(1)

   b)   O(log n)

   c)   O(n^2)

   d)   O(n)
QUESTION 16
What is the worst-case performance of the add method in a binary search tree with linked nodes?

   a.   O(1)

   b.   O(log n)

   c.   O(n^2)

   d.   O(n)

Explanation / Answer

Answers:

1. a

2. c

3. a

4. d

5. d

6. b

7. b

8. a

9. a

10. b

11. c

12. c

13. b

14. a

15. d

16. d

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote