CSCI-313 Instructor: Professor Xiaopeng Tao, Ph.D Homework 6 ...

Report 83 Downloads 262 Views
Queens College Data Structures Course: CSCI-313 Instructor: Professor Xiaopeng Tao, Ph.D


Homework 6

Created By: Michael Lawrence Date executed: Date handed in: Grade:________________

R-6.4 Implement a method with signature transfer(S, T) that transfers all elements from stack S onto stack T, so that the element that starts at the top of S is the first to be inserted onto T, and the element at the bottom of S ends up at the top of T.

C-6.21 Describe a non-recursive algorithm for enumerating all permutations of the numbers 1, 2, ..., n using an explicit stack. I don't understand this problem. I have spent a considerable amount of time trying to run the Java Solution without success.

P-6.40 Give a complete implementation of the Deque ADT using a fixedcapacity array, so that each of the update methods runs in O(1) time. Coding in progress. Solution will be posted shortly.

Hint: The section on the Deque ADT gives advice on using a circular array implementation.

2

Recommend Documents