Material Type: Quiz;
Class: Data Structures and Algorithms;
Subject: Electrical & Computer Engineer;
University: Virginia Polytechnic Institute And State University;
Term: Unknown 2011;
Download 4 Questions Quiz 7 - Data Structures and Algorithms | ECE 2574 and more Quizzes Data Structures and Algorithms in PDF only on Docsity!
ECE 2574 Quiz 7 {Please do not write your SS# or your VT Passport ID# on this paper} ee a 2 | list S Hp, prev & Figure 1. A Circular Linked List 1. {magine a circular linked list of integers as Figure 1 illustrates. The external pointer 1ist points to the last nede. !f you apply the method given below, called doSomething, to the linked list in Figure 1, what happens? Explain. void doSomething(Node *& list) { Node *cur, *prev, *temp, *stop; if (list = NULL) { stop = list; prev = list; cur = prev->next; list = list->next; do { temp = cur->next; cur->next = prev; prev = cur; . cur = temp; }while (cur != stop); cur->next = prev; } } // end doSomething “ This will feve fe i voter of fz lished sk THE hoes Mas g US reg. ek poole te chor x fla foes punks