(BI). Implement a Red-Black tree with only operation Insert(). Your program should read from a file that contain positive integers and should insert those numbers into the RB tree in that order. Note that the input file will only contain distinct integers. Print your tree by level using positive values for Black color and negative values for Red color. Do not print out null nodes. Format for a node: (, ). For example, the following tree is represented as (12, null) (5, 12) (15, 12) (3,5) (-10, 5) (13, 15) (17, 15) (-4, 3) (7,-10) (11, -10) (-14, 13) (-6, 7) (-8, 7) 4 5 6 7 12 10 8 11 13 15 14 17
(BI). Implement a Red-Black tree with only operation Insert(). Your program should read from a file that contain positive integers and should insert those numbers into the RB tree in that order. Note that the input file will only contain distinct integers. Print your tree by level using positive values for Black color and negative values for Red color. Do not print out null nodes. Format for a node: (, ). For example, the following tree is represented as (12, null) (5, 12) (15, 12) (3,5) (-10, 5) (13, 15) (17, 15) (-4, 3) (7,-10) (11, -10) (-14, 13) (-6, 7) (-8, 7) 4 5 6 7 12 10 8 11 13 15 14 17
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 6 steps with 6 images