Question 6 The worst-case run-time to change the priority of a heap element is: A. 0(nlogn) Β. Θ(η) C. 0(1) D. 0(logn) E. 0(²) Question 7 Consider a maximum heap, represented by an array: 52, 42, 32, 22, 27, 28, 29, 20, and 16. Now consider that a value 47 is inserted into this heap. What is the new heap after the insertion? A. 52, 42, 32, 22, 27, 28, 29, 20, 16, 47 B. 52, 47, 32, 42, 27, 28, 29, 22, 16, 20 C. 52, 42, 32, 22, 47, 28, 29, 20, 16, 27 D. 52, 47, 32, 22, 42, 28, 29, 20, 16, 27 E. 52, 47, 32, 42, 27, 28, 29, 22, 20, 16 Question 8 The output of an in-order traversal of a binary tree is 1,2,3,4,5,6, and the output of pre- order traversal of the same binary tree is 6,1,4,2,3,5. What is the output of the post-order traversal of the same binary tree? A. 3,1,4,5,2,6 B. 3,2,4,5,1,6 C. 3,2,5,4,1,6 D. 1,2,4,6,5,3 E. 3,2,5,1,4,6 Question 9 Given an array A storing n elements. Which one of the following statements is true? A. Heap sort is always the slowest algorithm in practice to sort A. B. Shell sort is always the fastest algorithm in practice to sort A. C. If A is almost sorted, selection sort should be used. D. If A is sorted using selection sort, the best case and worst case run-time complexity are the same. E. If A is so large that it does not fit into the main memory, quick sort should be used.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Question 6
The worst-case run-time to change the priority of a heap element is:
A. (nlogn)
B. 0(n)
C. 0(1)
D. 0(logn)
Ε. Θ(n2)
Question 7
Consider a maximum heap, represented by an array: 52, 42, 32, 22, 27, 28, 29, 20, and
16. Now consider that a value 47 is inserted into this heap. What is the new heap after
the insertion?
A. 52, 42, 32, 22, 27, 28, 29, 20, 16, 47
B. 52, 47, 32, 42, 27, 28, 29, 22, 16, 20
C. 52, 42, 32, 22, 47, 28, 29, 20, 16, 27
D. 52, 47, 32, 22, 42, 28, 29, 20, 16, 27
E. 52, 47, 32, 42, 27, 28, 29, 22, 20, 16
Question 8
The output of an in-order traversal of a binary tree is 1,2,3,4,5,6, and the output of pre-
order traversal of the same binary tree is 6,1,4,2,3,5. What is the output of the post-order
traversal of the same binary tree?
A. 3,1,4,5,2,6
B. 3,2,4,5,1,6
C. 3,2,5,4,1,6
D. 1,2,4,6,5,3
E. 3,2,5,1,4,6
Question 9
Given an array A storing n elements. Which one of the following statements is true?
A. Heap sort is always the slowest algorithm in practice to sort A.
B. Shell sort is always the fastest algorithm in practice to sort A.
C. If A is almost sorted, selection sort should be used.
D. If A is sorted using selection sort, the best case and worst case run-time complexity
are the same.
E. If A is so large that it does not fit into the main memory, quick sort should be used.
Transcribed Image Text:Question 6 The worst-case run-time to change the priority of a heap element is: A. (nlogn) B. 0(n) C. 0(1) D. 0(logn) Ε. Θ(n2) Question 7 Consider a maximum heap, represented by an array: 52, 42, 32, 22, 27, 28, 29, 20, and 16. Now consider that a value 47 is inserted into this heap. What is the new heap after the insertion? A. 52, 42, 32, 22, 27, 28, 29, 20, 16, 47 B. 52, 47, 32, 42, 27, 28, 29, 22, 16, 20 C. 52, 42, 32, 22, 47, 28, 29, 20, 16, 27 D. 52, 47, 32, 22, 42, 28, 29, 20, 16, 27 E. 52, 47, 32, 42, 27, 28, 29, 22, 20, 16 Question 8 The output of an in-order traversal of a binary tree is 1,2,3,4,5,6, and the output of pre- order traversal of the same binary tree is 6,1,4,2,3,5. What is the output of the post-order traversal of the same binary tree? A. 3,1,4,5,2,6 B. 3,2,4,5,1,6 C. 3,2,5,4,1,6 D. 1,2,4,6,5,3 E. 3,2,5,1,4,6 Question 9 Given an array A storing n elements. Which one of the following statements is true? A. Heap sort is always the slowest algorithm in practice to sort A. B. Shell sort is always the fastest algorithm in practice to sort A. C. If A is almost sorted, selection sort should be used. D. If A is sorted using selection sort, the best case and worst case run-time complexity are the same. E. If A is so large that it does not fit into the main memory, quick sort should be used.
Question 10
Consider the following weighted graph. Weights of edges are given in parentheses.
a(8)
B. b, d, f, g
C. a, d, e, h
D. a, b, h, g
E. b, d, e, g
b(7)
c(9)
d(4)
f(5)
e(3)
h(6)
g(2)
Which of the following sets of edges is a minimum spanning tree?
A. b, e, g, h
Transcribed Image Text:Question 10 Consider the following weighted graph. Weights of edges are given in parentheses. a(8) B. b, d, f, g C. a, d, e, h D. a, b, h, g E. b, d, e, g b(7) c(9) d(4) f(5) e(3) h(6) g(2) Which of the following sets of edges is a minimum spanning tree? A. b, e, g, h
Expert Solution
Step 1

The answer for the above mentioned question is given in the below steps for your reference.

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Heapsort
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education