Array Data Structure Last Updated : 31 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In this article, we introduce array, implementation in different popular languages, its basic operations and commonly seen problems / interview questions. An array stores items (in case of C/C++ and Java Primitive Arrays) or their references (in case of Python, JS, Java Non-Primitive) 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.It is not useful in places where we have operations like insert in the middle, delete from middle and search in a unsorted data.It is a fundamental and linear data structure using which we build other data structures like Stack Queue, Deque, Graph, Hash Table, etc. Basics Introduction to Arrays Applications of Array In Different Language Arrays in C Vector in C++ STL Arrays in Java ArrayList in Java List in Python Arrays in C# Arrays in JavaScript Basic Problems Print AlternatesLeaders in an array Check if SortedRemove Duplicates from Sorted Generate all Subarrays Reverse an Array Rotate an Array Zeroes to End Min Increments to Make Equal Min Cost to Make Size 1 Easy Problems Duplicate within K DistanceMake Even Positioned GreaterSum of all SubarraysStock Buy and Sell – Multiple TransactionsSingle Among DoublesMissing NumberMissing and RepeatingOnly Repeating from 1 to n-1Sorted Subsequence of Size 3 Max Subarray SumEquilibrium index Two Sum - Find if there is a PairTwo Sum - Closest Pair [More problems on 2 Sum in Medium Section]Split array into three equals Maximum Consecutive 1s with K Flips Prerequisite for the Remaining ProblemsBinary SearchSelection Sort, Insertion Sort, Binary Search, QuickSort, MergeSort, CycleSort, and HeapSortSort in C++ / Sort in Java / Sort in Python / Sort in JavaScriptTwo Pointers Technique Prefix Sum TechniqueBasics of Hashing Window Sliding Technique Medium Problems Make arr[i] = i Maximum Circular Subarray SumReorder according to given indexes Product Except SelfK-th Largest Sum Subarray Smallest missing number Smallest subarray with sum greater than x Majority Element Count possible triangles Sub-array with given sum Longest Subarray with Equal 0s and 1sLongest Common Span in Two Binary Arrays Construct an array from its pair-sum array 2 Sum - All Pairs2 Sum - Distinct Pairs3 Sum - Find Any3 Sum - Closest Triplet4 Sum - Find Any [More problems on 4 Sum in Hard Section] Hard Problems Surpasser Count Trapping Rain Water Top K Frequent Elements Kth Missing Positive Number in a Sorted ArrayStock Buy and Sell - At Most K TransactionsStock Buy and Sell - At Most 2 TransactionsMedian in a StreamSmallest Difference Triplet from 3 arrays Max occurred in n ranges3 Sum - Distinct Triplets 3 Sum - All Triplets4 Sum - Distinct Quadruples 4 Sum - All Quadruples4 Sum - Closest QuadrupleExpert Problems for Competitive Programmers MO’s Algorithm Square Root (Sqrt) Decomposition Algorithm Sparse Table Range sum query using Sparse Table Range Minimum Query (Square Root Decomposition and Sparse Table) Range LCM Queries Merge Sort Tree for Range Order Statistics Minimum number of jumps to reach end Space optimization using bit manipulations Max value of Sum( i*arr[i]) with only rotations allowed Quick Links : ‘Practice Problems’ on Arrays Top Array Interview Questions ‘Quizzes’ on Arrays What is Array What is Array Array Practice Problems Comment More info H harendrakumar123 Follow Improve Article Tags : DSA Arrays Explore DSA FundamentalsLogic Building Problems 2 min read Analysis of Algorithms 1 min read Data StructuresArray Data Structure 3 min read String in Data Structure 2 min read Hashing in Data Structure 2 min read Linked List Data Structure 2 min read Stack Data Structure 2 min read Queue Data Structure 2 min read Tree Data Structure 2 min read Graph Data Structure 3 min read Trie Data Structure 15+ min read AlgorithmsSearching Algorithms 2 min read Sorting Algorithms 3 min read Introduction to Recursion 14 min read Greedy Algorithms 3 min read Graph Algorithms 3 min read Dynamic Programming or DP 3 min read Bitwise Algorithms 4 min read AdvancedSegment Tree 2 min read Binary Indexed Tree or Fenwick Tree 15 min read Square Root (Sqrt) Decomposition Algorithm 15+ min read Binary Lifting 15+ min read Geometry 2 min read Interview PreparationInterview Corner 3 min read GfG160 3 min read Practice ProblemGeeksforGeeks Practice - Leading Online Coding Platform 6 min read Problem of The Day - Develop the Habit of Coding 5 min read Like