Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- Nil = new Node(NilValue);
- /// ***** Do your Code Here***** ///
- RedBlackTree t ;
- ll a ;
- while(1)
- {
- ll c ;
- cout << "1. Insert \n2. Delete" << endl ;
- cin >> c >> a;
- Node *n ;
- n = new Node(a);
- if(c == 1)
- {t.Insert(n);}
- else if(c==2)
- {
- t.RBdelete(t.Search(a));
- }
- cout << "Success" << endl << endl ;
- cout << "Asc Print: " ;
- t.AscPrint(t.Root);
- cout << endl ;
- cout << "Min: " << t.RBmin(t.Root)->Value << endl ;
- cout << "Max: " << t.RBmax(t.Root)->Value << endl ;
- }
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement