Menu
Coddy logo textTech

Introduction

Lesson 21 of 26 in Coddy's Arrays in C++ course.

 

A subarray is a contiguous subpart of the array.

Example.

Arr[]={1,2,3,4,5,6}

Subarrays are

  1. {1,2}
  2. {2,3,4}
  3. {1,2,3,4}
  4. {2,3,4,5,6} and so on...

here {1,3,5} is not a subarray, as the elemnts 1, 3, 5 are not next to eaach other in given array.

 

The only condition is that it must be a continuous part of the array.

 

 

 

Try it yourself

This lesson doesn't include a code challenge.

All lessons in Arrays in C++