Stack implemented as array and as linked list