# Arrays Data Structure

## In this complete guide to Array Data Structures, you will learn about the basics of Arrays, how to get started with Array, learning, strategy, resources, problems, and much more.

8

Chapters

2

Quizzes

88

Articles

60

Problems

Discover a smoother learning journey through our effortless roadmap

Start your journey## Chapters

### Getting Started with Arrays

### Array Operations

Different ways of accessing array elements in C++

Why does accessing an Array element take O(1) time?

Inserting Elements in an Array | Array Operations

Searching Elements in an Array | Array Operations

Deleting Elements in an Array | Array Operations

Search, Insert, and Delete in an Unsorted Array | Array Operations

Search, Insert, and Delete in an Sorted Array | Array Operations

### Array Searching

### Problems on Array Searching

### Array Sorting

Selection Sort â€“ Data Structure and Algorithm Tutorials

Bubble Sort - Data Structure and Algorithm Tutorials

Insertion Sort - Data Structure and Algorithm Tutorials

Heap Sort - Data Structures and Algorithms Tutorials

Merge Sort - Data Structure and Algorithms Tutorials

QuickSort - Data Structure and Algorithm Tutorials

### Problems on Array Sorting

### Multi-dimensional Arrays

### Prefix Sum Array

Prefix Sum Array - Implementation and Applications in Competitive Programming

Equilibrium index of an array

Subarray with 0 sum

Maximum subarray size, such that all subarrays of that size have sum less than k

Finding absolute difference of sums for each index in an Array

Longest subarray with sum divisible by K

Find an element in array such that sum of left array is equal to sum of right array

### Prefix Sum of Matrix

### Two Pointers Technique on Array

Two Pointers Technique

Find the closest pair from two sorted arrays

Given a sorted array and a number x, find the pair in array whose sum is closest to x

Find all triplets with zero sum

Triplet Sum in Array (3sum)

Find a triplet such that sum of two equals to third element

Find four elements that sum to a given value (4Sum) | Set 1 (n^3 solution)

### Easy Problems on Array

Write a program to reverse an array or string

Program to find the minimum (or maximum) element of an array

Move all negative numbers to beginning and positive to end with constant extra space

Find a peak element which is not smaller than its neighbours

Sort an array of 0s, 1s and 2s | Dutch National Flag problem

Count number of occurrences (or frequency) in a sorted array

Union and Intersection of two sorted arrays

Find Subarray with given sum | Set 1 (Non-negative Numbers)

Kâ€™th Smallest/Largest Element in Unsorted Array

### Medium Problems on Array

Find duplicates in O(n) time and O(1) extra space | Set 1

Program to cyclically rotate an array by one

Find the first repeating element in an array of integers

Find the Missing Number

Count pairs with given sum

Find common elements in three sorted arrays

Find first non-repeating element in a given Array of integers

Count subarrays with equal number of 1's and 0's

Rearrange array in alternating positive & negative items with O(1) extra space | Set 1

Subarray with 0 sum

Largest Sum Contiguous Subarray (Kadane's Algorithm)

Find the Factorial of a large number

Find the Minimum element in a Sorted and Rotated Array

Maximum sum of i*arr[i] among all rotations of a given array

### Hard Problems on Array

Find the missing and repeating number

Maximum Sum Path in Two Arrays

Given an array arr[], find the maximum j - i such that arr[i] <= arr[j]

Given a sorted array and a number x, find the pair in array whose sum is closest to x

Find the smallest positive integer value that cannot be represented as sum of any subset of a given array

Chocolate Distribution Problem

## About the Complete Guide to Arrays

The dream of every programmer is to become not just a good, but also a great programmer. We all want to achieve our goals and to achieve our goals, we must have a great plan with us. In this context, we have decided to provide a complete guide for Arrays interview preparation, which will help you to tackle the problems that are mostly asked in the interview, such as What is an Array, What is Array in C language, How do you initialize an Array in C, How to sort an Array, etc. We have also covered the topics such as Top Theoretical interview questions and Top interview coding questions in this complete guide for Array interview preparation.

### Basic terminologies of array

While learning about Array Data Structures in this Complete Guide on Arrays, you will come across some common terms that will be used multiple times. Some of these terms are:

- Array Index: In an array, elements are identified by their indexes. Array index starts from 0.
- Array element: Elements are items stored in an array and can be accessed by their index
- Array Length: The length of an array is determined by the number of elements it can contain.

## Why Array Data Structures is needed?

Assume there is a class of five students and if we have to keep records of their marks in examination then, we can do this by declaring five variables individual and keeping track of records but what if the number of students becomes very large, it would be challenging to manipulate and maintain the data.

### What it means is that, we can use normal variables (v1, v2, v3, ..) when we have a small number of objects. But if we want to store a large number of instances, it becomes difficult to manage them with normal variables. The idea of an array is to represent many instances in one variable.

## Reviews

Payal Mujavadiya

This is a very good roadmap to understand the basics. This covers all types of data structures and Algorithms concepts. I am totally satisfied with the contents of this roadmap.

Sachin Motwani

The topics in this roadmap are explained clearly, and practice problems given were very helpful to implement the concepts learnt. Kudos to GeeksforGeeks!!!

Shreya Kumari

This roadmap has been a one-stop destination for my basics revision. GeeksforGeeks has touched all the important topics with the best approach. This roadmap has a huge role in getting me placed.

Potta Lokesh

The roadmap on GFG are well structured. The order of reading is awesome. It helped me a lot.

## FAQ's

How can I start this course?

You just need to click on the button that says START YOUR JOURNEY, and that's it. You will be taken to your first chapter.

Is this a language-specific course?

No. Majority topics in the course include implementations in popular programming languages like C, C++, Java, Python, C#, and Javascript.

Does the course include programming questions?

Yes, the course focuses on DS & Algo with a mix of theoretical topics and programming questions.

Can I learn DSA live?

Yes, we do have LIVE batched for DSA. You may call us on our toll-free number: +91-7838223507 or Drop us an email at courses@geeksforgeeks.org for any queries.