A recursive computation of the size of a list can work as follows:

A) set a local counter to zero; loop through the list, incrementing the counter by one at each element of the list; return the counter
B) recursively compute the size of the tail, add one, and return the result
C) if the list is not empty, recursively compute the size of its tail, add one, and return the result
D) if the list is empty, return zero; otherwise, recursively compute the size of the tail, add one, and return the result

D) if the list is empty, return zero; otherwise, recursively compute the size of the tail, add one, and return the result

Computer Science & Information Technology

You might also like to view...

Which of the following are not valid Java identifiers? Why?

a. Factorial b. anExtremelyLongIdentifierIfYouAskMe c. 2ndLevel d. level2 e. MAX_SIZE f. highest$ g. hook&ladder

Computer Science & Information Technology

Any XHTML document that omits the ____ element is rejected.

A. sub B. p C. title D. none of the above

Computer Science & Information Technology