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

6. b. If a binary search tree contains 63 nodes, what is the maximum time requir

ID: 3538409 • Letter: 6

Question

6.


b. If a binary search tree contains 63 nodes, what is the maximum time required to search for a matching value among its nodes?

c. How many leaves are there in a binary search tree with 7 nodes?




9.


a. which aspect of vector does deque implement?

b. which apsect of list does deque implement?

c. What happens to a deque when the clear operation is called?

d. What happens to a deque when the erase operation is called?



12.


c. Name three set-theoretic operations from the STL algorithms library.

d. You want a data structure that keeps track of whether shareholders are present at a corporate meeting. Would you choose a map or a set? explain.

Explanation / Answer

6. b) 6

6. c) 4

9. a) Deque is a sequence that supports random access to elements just like the vectors.

9. b) Deque is also a doubly linked list which supposts adding and deleting at both ends just like the lists.

9. c) Clear empties the deque.

9. d) Erase operation is used to remove single or a range of elements from a deque.


12. c) i)set_union

ii)set_intersection

iii)set_difference

12. d) We should use set. Because we can make a set of stakeholders which are present in the meeting and later we can search for a specific stakeholder from that set.