You are on page 1of 1

1) Arrays :An array is a data structure that stores a collection of elements (values or variables),

each identified by at least one array index or key.

Arrays are typically implemented as a contiguoArrays are typically implemented as a


contiguous block of memory.us block of memory.

Stacks :A stack is a last in, first out (LIFO) abstract data type and linear data structure.
Stacks can be implemented using a variety of data structures, including arrays, linked lists,
and trees.

The below is an example of an array because the items can be accessed randomly

2) Stacks are a fundamental data structure that follows the Last In, First Out (LIFO)
principle, meaning that the last element added to the stack is the first one to be
removed. Elements are added and removed from the top of the stack, and the
stack typically supports two main operations: push (adding an element to the top
of the stack) and pop (removing the top element from the stack).
One computer-based application of a stack is in the implementation of function
calls and recursion

You might also like