Texas Instruments interview question

How would you write an efficient data structure that would represent a deck of cards.

Interview Answers

Anonymous

17 Feb 2011

Use a CardLayout. In Java, this would be cardLayout.add(someCard); (with the appropriate initial set up).

Anonymous

7 Jan 2010

An array