Stack Generic LinkedList#10634

Stack Generic LinkedList

1 second
128 megabytes
Very easy

Implement a generic Stack.

Implement interface Stackable<T>.

Implement class MyStack<T> based on LinkedList data structure that implements interface Stackable<T>.

interface Stackable<T> 
{
  void push(T value); // push element to the top of the stack
  T pop();            // remove and return element from the top of the stack 
  T peek();           // return element from the top of the stack 
  boolean Empty();    // check if stack is empty
  int size();         // return size of the stack
}

class MyStack<T> implements Stackable<T> 
{
  public LinkedList<T> s;
   ...
}