Consider the following algorithm:Algorithm insertDbl (list, dataIn)This algorithm inserts data into a doubly linked list.Pre list is metadata structure to a valid list dataIn contains the data to be insertedPost The data have been inserted in sequenceReturn 0: failed--dynamic memory overflow 1: successful 2: failed--duplicate key presented if (full list) return 0 end if set found to searchList (list, predecessor, successor, dataIn key) if (not found) allocate new node move dataIn to new node if (predecessor is null) set new node back pointer to null set new node fore pointer to list head set list head to new node else set new
node fore pointer to predecessor fore pointer set new node back pointer to predecessor end if if (predecessor fore null) set list rear to new node else set successor back to new node end if set predecessor fore to new node return 1 end if return 2end insertDblWhat does the condition "if (predecessor fore null)" test for?
A. insertion at beginning of list
B. insertion at end of list
C. insertion in an empty list
D. insertion in a null list
Answer: B
You might also like to view...
If you declare an instance variable at the bottom of a class, it may not be accessed at the top of the class.
Answer the following statement true (T) or false (F)
Which statement is true regarding the following Dim statement?
Dim states(49) As String, populations(49) As Double (A) It is invalid since more than one array is dimensioned by a single Dim statement. (B) It is invalid since the two arrays must have the same data type. (C) The subscripts of states range from 1 to 49. (D) The subscripts of populations range from 0 to 49.
Answer the following statements true (T) or false (F)
a) The VISA Invoice Specification enables commercial credit-card users to maintain and leverage more detailed information on credit-card purchases. b) Client and server applications can use BIPS to communicate payment instructions over the Internet. c) cXML is an acronym for Cash XML d) An XBRL document contains three elements: group, items and label. e) XUL was created by Microsoft
Enter the ifdemo.html text into a new Web page. Load this page, then describe how it behaves when you enter various grades in the text box.
Once you have done this, modify the page by replacing the if statement in the ShowMessage function with the third if statement example. Load this modified page and describe how it behaves when you enter various grades.