Back to Browse

GRE Computer Science Question 60

1.4K views
Apr 4, 2012
4:18

60. Suppose that stacks and queues are provided as opaque data types, offering only operations to add elements, to remove elements, and to test for emptiness. Suppose that a programmer wants to count the number of elements in a given stack or queue C, which is currently in some state t, using only one auxiliary stack or queue D. The structures C and D can be used in any way possible based on the methods they offer, but C must be restored to its state t after counting its elements. Counting elements as described above is possible for which of the following data types? I. C is a queue and D is a queue. II. C is a stack and D is a stack. III. C is a queue and D is a stack. (A) None (B) I and II only (C) I and III only (D) II and III only (E) I, II, and III

Download

0 formats

No download links available.

GRE Computer Science Question 60 | NatokHD