Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer these multiple choice questions. 37. - 43. Answer the following questions based on this tree: 37. Write the complete binary tree as an

Please answer these multiple choice questions.

image text in transcribed

image text in transcribed

37. - 43. Answer the following questions based on this tree: 37. Write the complete binary tree as an array. (a) 1614121078965114 (c) 1614108976512114 (b) 1614121071148965 (d) 8910657141141216 38. If the element 18 is added to the heap, what elements will it be swapped with to fix the heap? (a) 11,12,16 (c) 11,12 (b) 5,7,14,16 (d) 8,10,14 39. If the heap is popped, which element will be removed and returned? (a) 16 (c) 5 (b) 8 (d) 4 40. If the heap is popped, which swaps will happen to fix the heap? (a) 165,5124 (c) 165,514109 (b) 1614109 (d) 161211 41. How long does it take to add an element to a heap? (a) O(logn) (c) O(1) (e) O(n) (b) O(n2) (d) O(nlogn) 42. How long does it take to access the maximum element in a heap? (a) O(logn) (c) O(1) (e) O(n) (b) O(n2) (d) O(nlogn) 43. How long does it take to pop a heap? (a) O(logn) (c) O(1) (e) O(n) (b) O(n2) (d) O(nlogn)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions