Use this list to answer the following questions Assume that list current temp

Use this list to answer the following questions

This preview shows page 2 - 3 out of 3 pages.

additional variables. Use this list to answer the following questions: (Assume that list, current, temp, trail, and last are pointers of type node) a) What is the output, if any, of each of the following statements? 1) cout << current->info; 2) current = current->link; cout << current->info; 3) cout << temp->link->link->info; 4) trail->link = NULL; cout << trail->info; 5) cout << last->link->info; b) What is the value of each of the following relational expressions? 1) current->link == temp 2) temp->link->link->info >= 50 3) current->link->link < 90 4) last->link == NULL 5) list != current
Image of page 2
Page 3 of 3 Q4) Written below is a pseudocode for an algorithm that isn’t correct. It was meant to check if a sequence of parenthesis were balanced. declare a character stack while ( more input is available) { read a character if ( the character is a '(' ) push it on the stack else if ( the character is a ')' and the stack is not empty ) pop a character off the stack else print "unbalanced" and exit } print "balanced" Which of the unbalanced parenthesis would this code segment consider balanced? a) ((()) b) ())(() c) (()())) d) (()))() Q5) Write the code to delete a specific node from the linked list Good Luck
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

  • Fall '17
  • Tahir Iqbal

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes