Data Structures - Array

0


Today we will talk about arrays.



What is Array?

An array is a collection of elements of similar data types.

Array Can be dynamic or static

Static Array - Size cannot be changed.
Dynamic Array - Size Can be changed by memory reallocation.

Memory Representation of array:  


Properties of array:

  1. Elements in an array are stored in contiguous memory locations.
  2. Elements in an array can be accessed using the base address in constant time O(1).
  3. Changing the size of an array is not possible but we can reallocate it to some bigger memory location.


Post a Comment

0Comments
Post a Comment (0)