Need this in C++ please, thank you.
The following program inserts some nodes into a red-black tree and then removes some nodes. Try the following activities to see if you can predict how the tree will change: Sort the list of keys before inserting into the tree. Does the height of the tree change significantly? • What key could be added to the end of the keys list that would cause at least one rotation when the node is inserted? • Remove the root node. • Remove a red leaf node. Remove a black leaf node. • What removal cases are triggered when removing various nodes in the tree? Current file: main.cpp 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include "RedBlackTree.h" 5 #include "RBTPrint.h" 6 using namespace std; 7 8 void Spacesplit(const string& str, vector<string> & output) { 9 10 11 12 13 14 15 16 17 18 size_t startIndex = 0; size_t endIndex = str.find('', startIndex); while (endIndex != string: :npos) { // Onty push non-empty strings if (endIndex> startIndex) { } // Get the next start and end indices startIndex endIndex + 1; Load default template... output.push_back(str. substr(startIndex, endIndex startIndex));
Need this in C++ please, thank you.
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am