0% found this document useful (0 votes)
7 views4 pages

Array Data Structure - GeeksforGeeks

Uploaded by

Bukata Uteka
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Array Data Structure - GeeksforGeeks

Uploaded by

Bukata Uteka
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DSA Tutorial Interview Questions Quizzes Must Do Advanced DSA System Design Aptitude Puzzles Interview Corner DSA

erview Corner DSA Python

Array Data Structure


Last Updated : 3 Mar, 2026

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
Introduction
Applications

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 Alternates
Leaders in an array
Remove 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 Distance
Make Even Positioned Greater
Sum of all Subarrays
Stock Buy and Sell – Multiple Transactions
Single Among Doubles
Missing Number
Missing and Repeating
Only Repeating from 1 to n-1
Sorted Subsequence of Size 3
Max Subarray Sum
Equilibrium index
Split array into three equals

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
Make arr[i] = i
Maximum Circular Subarray Sum
Reorder according to given indexes
Product Except Self
K-th Largest Sum Subarray
Smallest subarray with sum greater than x
Majority Element
Count possible triangles
Construct an array from its pair-sums
Next Permutation

Hard Problems
Surpasser Count
Trapping Rain Water
Top K Frequent Elements
Kth Missing Positive Number in a Sorted Array
Stock Buy and Sell - At Most K Transactions
Stock Buy and Sell - At Most 2 Transactions
Median in a Stream
Smallest Difference Triplet from 3 arrays
Max occurred in n ranges

Expert Problems for Competitive Programmers


MO’s Algorithm
Square Root (Sqrt) Decomposition
Sparse Table
Range sum query using Sparse Table
Range Minimum Query
Range LCM Queries
Merge Sort Tree for Range Order Statistics
Minimum jumps to reach end
Space optimization using bit manipulations
Max value of Sum( i*arr[i]) with only rotations

Quick Links :
Practice Problems on Arrays
Array Interview Questions
Quiz on Arrays
DSA Tutorial

H ha… 85

Article Tags:

DSA Arrays

Explore

DSA Fundamentals

Data Structures

Algorithms

Advanced

Interview Preparation

Courses
Company Explore Tutorials Courses Videos Preparation
About Us POTD Programming ML and Data DSA Corner
Corporate & Communications Address: Legal Job-A- Languages Science Python Interview
Privacy Thon DSA DSA and Java Corner
A-143, 7th Floor, Sovereign Corporate
Tower, Sector- 136, Noida, Uttar Policy Blogs Web Placements C++ Aptitude
Pradesh (201305) Contact Us Nation Technology Web Web Puzzles
Advertise Skill Up AI, ML & Development Development GfG 160
Registered Address:
with us Data Science Programming Data System Design
K 061, Tower K, Gulshan Vivante GFG DevOps Languages Science
Apartment, Sector 137, Noida, Gautam
Corporate CS Core DevOps & CS Subjects
Buddh Nagar, Uttar Pradesh, 201305
Solution Subjects Cloud
Campus Interview GATE
Training Preparation Trending
Program Software and Technologies
Tools

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

You might also like