eolymp
bolt
Try our new interface for solving problems
Məsələlər

Stack Generic ArrayList

Stack Generic ArrayList

Реализуйте generic Stack.

Реализуйте интерфейс Stackable<T>.

Реализуйте класс MyStack<T> на базе структуры данных ArrayList который имплементирует интерфейс 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 ArrayList<T> s;
   ...
}
Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 128 MiB
Müəllif Михаил Медведев