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...

How do we implement breadth-first search traversal of a tree?

a. By using the queue data structure b. By using the stack data structure c. Recursively choosing the right child node d. Starting at the leaf nodes and working our way up

Computer Science & Information Technology

To use the Presenter View, Windows must be configured to support _______.

A. one monitor and projector            B. two monitors C. one monitor only D. none of the above

Computer Science & Information Technology

Which protocol does the ping application use?

A. SMTP B. HTTP C. ICMP D. DHCP

Computer Science & Information Technology

A datacenter has two rows of racks which are facing the same direction. Sara, a consultant, recommends the racks be faced away from each other. This is an example of which of the following environmental concepts?

A. Fire suppression B. Raised floor implementation C. Hot and cool aisles D. Humidity controls implementation

Computer Science & Information Technology