Consider the following algorithm for inserting a node in a list:Algorithm insertNode(list, pPre, dataIn)   allocate (pNew)   set pNew data to dataIn   if (pPre null)      set pNew link to list head      set list head to pNew   else      set pNew link to pPre link      set pPre link to pNew   end if   return trueend insertNodeWhat special case does the "if (pPre null)" condition test for?

A. Adding before the first node.
B. Adding to an empty list.
C. Adding before the first node or to an empty list.
D. Adding at the end of the list.


Answer: C

Computer Science & Information Technology

You might also like to view...

The attribute declares the control modified by a control template.

a) Type b) TargetType c) TargetControl d) Control

Computer Science & Information Technology

Which drop-down menu still exists in the 2007 version of Word?

A) Tools B) Edit C) File D) Help

Computer Science & Information Technology

Which of the following is a constructor without parameters?

A. copy constructor B. default constructor C. finalizer D. modifier

Computer Science & Information Technology

FTP can only transfer ASCII files.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology