CIS 22

Final Sample Problems Here are just a couple problems that might resemble those you'll see on the final.

(1) Bitbucket Software Corp. is conducting research into implementing its own String class. They have identified a few operations that this class must provide, but have not yet decided on an internal representation for the String values. Your job is to help them compare two representations: as a Stack of characters, and as a Queue of characters. Specifically, for each operation below indicate whether a Stack-based or Queue-based representation would be better, and why. If you think it doesn't matter, say so and explain why. (Note that they haven't decided on parameter types and return values, so you can just focus on the operation that has to be performed).

a) concatenate
b) length
c) reverse
d) copy
e) is-empty

(2) Define/describe/explain the following concepts:

a) composition
b) separate chaining
c) friend
d) prefix notation
e) last-in first-out