Array Data Structure
TABLE OF CONTENTS
1. Basics of Array
Introduction to Array Data Structure
Read more → Introduction to Array Data Structure
Array Memory Representation
Read more → Array Memory Representation
Array Operations and Time Complexity
Read more → Array Operations and Time Complexity
Advantages and Disadvantages of Arrays
Read more → Advantages and Disadvantages of Arrays
Applications of Arrays
Read more → Applications of Arrays
2. Arrays in Different Programming Languages
Arrays in C
Read more → Arrays in C
Vector in C++ STL
Read more → Vector in C++ STL
Arrays vs ArrayList in Java
Read more → Arrays vs ArrayList in Java
Arrays in JavaScript
Read more → Arrays in JavaScript
3. Array Techniques (Prerequisites)
Binary Search on Arrays
Read more → Binary Search on Arrays
Two Pointer Technique
Read more → Two Pointer Technique
Prefix Sum Technique
Read more → Prefix Sum Technique
Sliding Window Technique
Read more → Sliding Window Technique
Basics of Hashing for Arrays
Read more → Basics of Hashing
4. Array Problems
4.1 Basic Array Problems
- Traverse an Array
- Find the Sum of All Elements in an Array
- Find the Maximum Element in an Array
- Find the Minimum Element in an Array
- Count Even and Odd Numbers
- Search an Element in an Array (Linear Search)
- Copy One Array into Another
- Reverse an Array
- Print Alternate Elements of an Array
- Find the Length of an Array
- Check if an Array is Sorted
- Find the First Element of an Array
- Find the Last Element of an Array
- Count the Number of Positive and Negative Elements
- Replace All Elements with Zero
- Sum of Elements at Even Indices
- Sum of Elements at Odd Indices
- Find the Average of Array Elements
- Print Array Elements in Reverse Order
- Count the Number of Zeros in an Array
4.2 Easy Array Problems
- Find the Second Largest Element in an Array
- Remove Duplicate Elements from an Array
- Move All Zeros to the End
- Rotate an Array by One Position
- Rotate an Array by K Positions
- Check if Two Arrays Are Equal
- Merge Two Sorted Arrays
- Find Missing Number in an Array
- Find Duplicate Elements in an Array
- Count Frequency of Each Element
- Find the Majority Element (Brute Force / Hashing)
- Find All Unique Elements
- Insert an Element at a Given Position
- Delete an Element from a Given Position
- Find the Index of an Element
- Find Union of Two Arrays
- Find Intersection of Two Arrays
- Sort an Array of 0s and 1s
- Find the Largest Sum Contiguous Subarray (Kadane’s Intro)
4.3 Medium Array Problems
- Kadane’s Algorithm (Maximum Subarray Sum)
- Two Sum Problem
- Subarray with Given Sum
- Longest Subarray with Sum K
- Count Subarrays with Given Sum
- Rearrange Array Alternately (Max–Min)
- Leaders in an Array
- Equilibrium Index of an Array
- Stock Buy and Sell (Single Transaction)
- Stock Buy and Sell (Multiple Transactions)
- Sort an Array of 0s, 1s, and 2s
- Find the Majority Element (Moore’s Voting Algorithm)
- Find All Pairs with Given Sum
- Longest Consecutive Sequence
- Product of Array Except Self
- Maximum Product Subarray
- Find the First Missing Positive Integer
- Count Inversions in an Array
- Rearrange Array by Sign (Positive and Negative)
- Check if Array Can Be Divided into Equal Sum Subarrays
4.4 Hard Array Problems
- Trapping Rain Water
- Maximum Circular Subarray Sum
- Find Minimum in Rotated Sorted Array
- Search in Rotated Sorted Array
- Median of Two Sorted Arrays
- Merge Intervals
- Count Reverse Pairs
- Longest Subarray with Equal 0s and 1s
- Largest Rectangle in Histogram
- Maximum Sum Rectangle in 2D Matrix
- Subarray Sum Equals K (Prefix Sum + Hashing)
- Count Distinct Elements in Every Window
- Sliding Window Maximum
- Find K Maximum Elements
- Minimum Number of Jumps to Reach End
- Chocolate Distribution Problem
- Find All Triplets with Zero Sum
- Kth Smallest Element in an Array
- Maximum Length Bitonic Subarray
- Smallest Subarray with Sum Greater Than X
4.5 Expert Array Problems
- Maximum Sum Submatrix
- Count Subarrays with XOR Equal to K
- Longest Arithmetic Subarray
- Find the Median in a Stream of Integers
- Split Array Largest Sum
- Minimum Cost to Make Array Equal
- Maximum Product of Three Numbers
- Longest Subarray with At Most K Distinct Elements
- Subarray with Maximum Bitwise AND
- Find All Subarrays with Equal Sum
- Partition Array into K Equal Sum Subsets
- Maximum Absolute Difference of Subarrays
- Smallest Missing Number in Sorted Array
- Find Repeating and Missing Numbers
- Maximum Length Subarray with Given GCD
- Count Subarrays with Product Less Than K
- Kth Largest Element in a Stream
- Minimum Operations to Make Array Alternating
- Maximum Sum of Non-Adjacent Elements (Circular)
- Find Lexicographically Smallest Array After Operations
