Open In App

Array Data Structure

Last Updated : 08 Dec, 2025
Comments
Improve
Suggest changes
64 Likes
Like
Report

An array is a fundamental and linear data structure that stores items at contiguous locations. Note that in case of C/C++ and Java-Primitive-Arrays, actual elements are stored at contiguous locations. And in case of Python, JS, Java-Non-Primitive, references are stored at contiguous locations. It offers mainly the following advantages over other data structures.

  • Random Access : i-th item can be accessed in O(1) Time as we have the base address and every item or reference is of same size.
  • Cache Friendliness : Since items / references are stored at contiguous locations, we get the advantage of locality of reference.

Arrays are used to build other data structures like Stack Queue, Deque, Graph, Hash Table, etc. An array is not useful in places where we have operations like insert in the middle, delete from middle and search in a unsorted data.

Basics

In Different Language

Basic Problems

Easy Problems

Prerequisite for the Remaining Problems

  1. Binary Search
  2. Selection Sort, Insertion Sort, Binary Search, QuickSort, MergeSort, CycleSort, and HeapSort
  3. Sort in C++ / Sort in Java / Sort in Python / Sort in JavaScript
  4. Two Pointers Technique
  5. Prefix Sum Technique
  6. Basics of Hashing
  7. Window Sliding Technique

Medium Problems

Hard Problems

Expert Problems for Competitive Programmers

Quick Links :


What is Array
Video Thumbnail

What is Array

Video Thumbnail

Array Practice Problems

Article Tags :

Explore