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

Array

The document provides an overview of data structures, specifically focusing on arrays, their properties, and operations. It discusses the advantages and disadvantages of arrays, including their fixed size and efficient memory usage. Additionally, it covers searching and sorting techniques, as well as the concept of two-dimensional arrays and their applications.

Uploaded by

nitinsingh3264
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)
5 views4 pages

Array

The document provides an overview of data structures, specifically focusing on arrays, their properties, and operations. It discusses the advantages and disadvantages of arrays, including their fixed size and efficient memory usage. Additionally, it covers searching and sorting techniques, as well as the concept of two-dimensional arrays and their applications.

Uploaded by

nitinsingh3264
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

Array ->

Tuesday, 24 June 2025 4:17 PM

Condition -> khtm krdiya ->

Array ->
First data structure ->

Data Structure --> organizing a data flow from the data source to the DB -> kese waha se aa
sakthe ho kese wapis data bhej sakthe ho ->

Efficient
Less memory consumption

Array ->
Collection of data in linear format ->

Collective in the such a way so that multiple data can be stored easily in the single variable and
single type ->

1. Multiple data ko store krtha hai


2. Single variable ->
3. Single type ->
Arr - int ----- int store
Arr - String ---- string store

Multiple store ->

Class -> 100 students -> 100 -> time consump

Let marks = [12,32,43,553,543,…….]

Array -> indexing zero base -> 0th element

Size -> 0 se start


Length -> 1

Size = length - 1

Arr = 5 ->
0
1
2
3
4

Adv ->
Multiple data
0
1
2
3
4

Adv ->
Multiple data
Easy access
Flexibility

Dis ->
Static
Fixed in nature

Ar[10] -> 10 element store ------ array ->


Static in size ->

Int arr[] = {12,3,3,4,4,5};


Arr[0] -> 12
Arr[2] -> 3
Arr[10] -> not define -> index out of bound exception ->

Array -> arraylist -> dynamic -> size vary

Row ->

Array -> single D -> rows


Double D -> rows and columns

Array declara 2 ->

1. Predefine
Int arr[] = {2,4,6,8,10};

2. User define arr

Array -> dabba bn jaega single variable ->

Int arr[] = new int[5];

Arr[3] ->3rd index provide hojeaga

Store -> loop


Print -> loop

Int arr[] =, syso(arr[])

User define ->

5 -> n - 5 ->

Searching ->
5 -> n - 5 ->

Searching ->

Arr ->
Key -> exist -> index
Not. Exist

Searching ->
Linear -> Time ->
Key - 100 100

Index by index value jaati hai ---- index ko dekhr value store hojati ha i

Binary -> -> Book ->

Sorting ->

Arrangement of element in an order -> asc , desc

Bubble ->
Insertion ->
Selection ->
Inbuilt ->

Wrapper ->

Autoboxing
Boxing

Int -> Integer


float -> Float
Char -> Character
double -> Double

2D -> two dimensional -> Pattern -> Matrix


2D -> Matrix

XXXXX
XXXXX

ROW ->

Row - Column

3x3

A[i][j] = k[j][i]
3x3

A[i][j] = k[j][i]

Arr ->

1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

4*4 ->

1,6,11,16 ---- left diagonal


4,7,10,13 ---- Right diagonal

1 -> (0,0)
6-> (1,1) Left diagonal -> (i==j) -> left diagonal
11 -> (2,2)
16 -> (3,3) If(i==j){ I=0
Sum = sum + arr[i][j]; J=0
Arr[i][j]
4 -> (0,3)
7 -> (1,2)
10 -> (2,1)
13 -> (3,0)

If((I + j ) == [Link] - 1)
{
Sum = sum + arr[i][j];
}

You might also like