Say you set the key for each position p of a binary tree T equal to its pre-order rank. Under what circumstances is T a heap? In other words, what property should T have to be a heap? Discuss about such a property.   If we are to insert "43," "18," and "2," on the binary tree shown below (it's also a heap!), what is the end result? Remember we need three steps to complete inserting in a heap: a) Place the new element in the next available position in the array. b) Compare the new element with its parent. If the new element is smaller, than swap it with its parent. c) Continue this process until either the new element’s parent is smaller than the new element or it reaches the root.                       HERE IS THE IMAGE Consider a red-black tree (RBT) T storing 1,024 elements. What is the worst-case height of T? As you recall, the height is the black height. You do not have to be correct in terms of the answer, but try to show the reason why it should be that number.

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
    • Say you set the key for each position p of a binary tree T equal to its pre-order rank. Under what circumstances is T a heap? In other words, what property should T have to be a heap? Discuss about such a property.  
    • If we are to insert "43," "18," and "2," on the binary tree shown below (it's also a heap!), what is the end result? Remember we need three steps to complete inserting in a heap: a) Place the new element in the next available position in the array. b) Compare the new element with its parent. If the new element is smaller, than swap it with its parent. c) Continue this process until either the new element’s parent is smaller than the new element or it reaches the root. 
                     HERE IS THE IMAGE
    • Consider a red-black tree (RBT) T storing 1,024 elements. What is the worst-case height of T? As you recall, the height is the black height. You do not have to be correct in terms of the answer, but try to show the reason why it should be that number. 
  • You can choose the topics selectively and answer them. However, the more you post, the more points you will get. You are encouraged to respond to at least one of your classmates' posts.
50
32
14
64 (53
5
41 (87
23
90
Transcribed Image Text:50 32 14 64 (53 5 41 (87 23 90
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Types of trees
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