Q:
What is the difference between stack and array?
Answer
Stack:
- Stack is a ordered collection of items
- Stack is a dynamic object whose size is constantly changing as items are pushed and popped .
- Stack may contain different data types
Array:
- Array is an ordered collection of items
- Array is a static object i.e. no of item is fixed and is assigned by the declaration of the array
- It contains same data types.
View answer
Workspace
Report Error
Discuss