Home » Interview » Technology

What is the difference between stack and array?

Correct 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 ie no of item is fixed and is assigned by the declaration of the array - It contains same data types

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion