Пример #1
0
 @Override
 public int pop() {
   // TODO Auto-generated method stub
   ListNode temp = head;
   head = head.next;
   return temp.getVal();
 }
Пример #2
0
 @Override
 public int peek() {
   // TODO Auto-generated method stub
   return head.getVal();
 }