Thread: Question about red-black tree and little code fragment.

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    1

    Question about red-black tree and little code fragment.

    Hallo to everyone.I ame new to c but i must do this 2 test question.I know it's annoying for you to look at the other homework but if some1 can help just with 1 correct/incorrect i will be very very thankful.

    Let us have a red-black tree ADT in parenthetic string representation, where black nodes are bold, and red nodes are italic. External nodes are not included in this representation. Determine the correct/incorrect resulting red-black tree after applying the corresponding operation.
    a. 7(9) – insertItem(10) – 9(7,10)
    b. 5(7) - insertItem (6) – (6,7)
    c. 8(3) - insertItem(6) – 3(4,8)
    d.6(2) insertItem(4) – 4(2,6)




    We have the following code fragment:
    Code:
    We have the following code fragment:
    void fun1() 
    { throw runtime_error("ERR" ); } 
    void fun2() throw(runtime_error) 
    { ... } 
    void fun3() throw(runtime_error) 
    { fun2(); } 
    int main() 
    { try 
      { fun3(); } 
      catch (runtime_error e) 
      { 
       cout<<e.what(); 
      } 
    return 0; 
    }
    Replacing ... with the given below statement, the message ERR prints on the screen. Is this assertion true?
    a. try { fun3() ; }
    b. catch ( . . . ) { dun3() ; }
    c. throw “RTE”;
    d. throw string(“RTE”) ; fun3() ;
    Last edited by mindvera; 07-05-2010 at 01:11 PM.

Popular pages Recent additions subscribe to a feed