Homework: Stack and Sequence Flip


  1. Implement the Stack family instance method flip declared as follows (this is a Stack<T>):

  2. Implement the Sequence family instance method flip declared as follows (this is a Sequence<T>):

  3. Provide a second, different implementation of the instance method flip for Sequence<T>. If your first implementation is iterative (i.e., uses a loop), your second one should be recursive and vice versa.