Array : Data Structure

Techno Freak
2 min readJul 12, 2022

Contagious memory locations

Array = collections of items .

Store multiple items of the same type together. Making it easy to traverse to calculate the position of the element by adding the memory location of the first element of the array (basically the name of the array).

Array Representation

Properties of Array:

  • Each element stored in the array is of same data type and of same size i.e 4 bytes.
  • Basically the elements in the array are stored at contiguous memory locations from which the first element is stored at the smallest memory location.
  • Elements of the array can be randomly accessed since we can calculate the address of each element of the array with the given base address and the size of the data element.

What is the Need of a Array ???

  • Storing multiple values in a single variable.
  • Sorting and searching values becomes simple.

Basics operations performed using an Array..

  • Update: It updates an element at a particular index.
  • Insertion :It is used to add an element at a particular index.
  • Deletion: It is used to delete an element from a particular index.
  • Search: It is used to search an element using the given index or by the value.
  • Traversal : This operation is used to print the elements of the array.

--

--

Techno Freak

Devops &Full-Stack enthusiast . Helping People to learn about cloud and opensource . Learning bit by bit