Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Create 3 seperate Files for the C++ Program. See instruction Below. Red-Black Tree Insertion - To receive a full credit, you should apply the

Please Create 3 seperate Files for the C++ Program. See instruction Below.

image text in transcribed
Red-Black Tree Insertion - To receive a full credit, you should apply the software engineering best practices by splitting the program into three files: header file, implementation file and main driver file. Write a program to insert a set of integers into an empty Red-Black tree by apply the Red-Black tree insertion algorithm that we have learned in class (see pdf lecture file). The program should display the final tree on the screen. Given integers: 9, 18, 7, 14, 17, 45, 26, 35, 50, 2, 1, 60 (you can terminate the input with a negative integer i.e. -1 or -9) Notes: You should test your program using different data sets to be sure it works correctly. Sample Output A balanced red-black tree after insertion Inserting nodes into an empty Red Black Tree. 9 18 7 14 17 45 26 35 50 2 1 60 17 Final balanced red-black tree: 26 ROOT - - - -17(BLACK) ----9(BLACK) 14 18 L----2(BLACK) L----1(RED) R- ---7(RED) R- - --14(BLACK) 35 50 R- -26 (BLACK) --18(BLACK) 60 R- - --45(RED L----35(BLACK) R-- --50(BLACK) R----60(RED)

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions