SlideShare une entreprise Scribd logo
1  sur  10
Arrays
Linear Arrays 
A linear array is a list of finite number n of homogeneous 
data elements. 
Length = UB-LB+1 
B: largest index 
B: smallest index
Memory representation 
LOC(LA[K]): add of the element LA[K] of the array LA. 
LOC(LA[K])=Base(LA)+W(K-LB)
Example 
AUTO which records the 
number of automobiles sold 
each year from 1932 to 1984. 
Base(Auto)=200 
W=4 words per memory cell 
Find the add of element which store 
The info about sale in year 1965????
Algorithm for traversing an 
array 
(Traversing a Linear Array) Here LA is a linear array 
with lower bound LB and upper bound UB. This 
algorithm traverses LA applying an operation 
PROCESS to each element of LA. 
1. [Initialize counter] Set K := LB. 
2. Repeat steps 3 and 4 while K <= UB. 
3. [Visit element] Apply PROCESS to LA[K]. 
4. [Increment counter] Set K := K + 1. 
[End of Step 2 loop.] 
. Exit.
Algorithm for inserting an element into an 
array 
(Inserting into a linear array) INSERT (LA, N, K, ITEM) 
Here LA is a linear array with N elements and K is a 
positive integer such that K <= N. 
This algorithm inserts an element ITEM into the Kth 
position in LA. 
1. [Initialize counter.] Set J := N. 
2. Repeat Steps 3 and 4 while J >= K. 
3. [Move Jth element downward.] Set LA[J+1] := 
LA[J]. 
4. [Decrease counter.] Set J := J – 1. 
[End of Step 2 loop.] 
5. [Insert element.] Set LA[K] := ITEM. 
6. [Reset N.] Set N := N + 1. 
7. Exit.
Algorithm for deleting an element from an 
array 
(Deleting from a linear array) DELETE (LA, N, K, ITEM) 
Here LA is a linear array with N elements and K is a 
positive integer such that K <= N. This algorithm 
deletes the Kth element from LA. 
1. Set ITEM := LA[K]. 
2. Repeat for J = K to N - 1. 
[Move J + 1st element upward.] Set LA[J] := LA[J + 1]. 
[End of loop.] 
3. [Reset the number N of elements in LA.] Set N := N - 1. 
4. Exit.
Algorithm for sorting an array (Bubble 
sort) 
(Bubble sort) BUBBLE (DATA, N) 
Here DATA is an array with N elements. This algorithm sorts 
the elements in DATA. 
1. Repeat Steps 2 and 3 for K = 1 to N – 1. 
2. Set PTR := 1. [Initialize pass pointer PTR.] 
3. Repeat while PTR <= (N – K): [Executes pass.] 
(a) If DATA[PTR] > DATA[PTR + 1], then: 
Interchange DATA[PTR] and DATA[PTR 
+ 1]. 
[End of If structure.] 
(b) Set PTR := PTR + 1. 
[End of inner loop.] 
[End of Step 1 outer loop.] 
4. Exit.
Example (Bubble sort) 
32,51,27,85,66,23,13,57
Example (Bubble sort)

Contenu connexe

Tendances

Tendances (20)

Arrays
ArraysArrays
Arrays
 
queue & its applications
queue & its applicationsqueue & its applications
queue & its applications
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure ppt
 
Data structure and its types.
Data structure and its types.Data structure and its types.
Data structure and its types.
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
 
Data Structure and Algorithms Linked List
Data Structure and Algorithms Linked ListData Structure and Algorithms Linked List
Data Structure and Algorithms Linked List
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applications
 
Queue
QueueQueue
Queue
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Stacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURESStacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURES
 
Data structures
Data structuresData structures
Data structures
 
Queues
QueuesQueues
Queues
 
Python set
Python setPython set
Python set
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure
 
Linked list
Linked listLinked list
Linked list
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
 
Double ended queue
Double ended queueDouble ended queue
Double ended queue
 
Array data structure
Array data structureArray data structure
Array data structure
 
Bfs and Dfs
Bfs and DfsBfs and Dfs
Bfs and Dfs
 

Similaire à Arrays Data Structure

BCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHIBCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHISowmya Jyothi
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1smruti sarangi
 
data structure and algorithm Array.pptx btech 2nd year
data structure and algorithm  Array.pptx btech 2nd yeardata structure and algorithm  Array.pptx btech 2nd year
data structure and algorithm Array.pptx btech 2nd yearpalhimanshi999
 
COMPUTER PROGRAMMING UNIT 1 Lecture 5
COMPUTER PROGRAMMING UNIT 1 Lecture 5COMPUTER PROGRAMMING UNIT 1 Lecture 5
COMPUTER PROGRAMMING UNIT 1 Lecture 5Vishal Patil
 
Lecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsLecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsAakash deep Singhal
 
Unit III Version I.pptx
Unit III Version I.pptxUnit III Version I.pptx
Unit III Version I.pptxssuserd602fd
 
Addressing Formulas for Sparse Matrices Using Column Major in 1D Arrays.pptx
Addressing Formulas for Sparse Matrices Using Column Major in 1D Arrays.pptxAddressing Formulas for Sparse Matrices Using Column Major in 1D Arrays.pptx
Addressing Formulas for Sparse Matrices Using Column Major in 1D Arrays.pptxAshishPandey502
 
2. Array in Data Structure
2. Array in Data Structure2. Array in Data Structure
2. Array in Data StructureMandeep Singh
 
PPT Lecture 2.2.1 onn c++ data structures
PPT Lecture 2.2.1 onn c++ data structuresPPT Lecture 2.2.1 onn c++ data structures
PPT Lecture 2.2.1 onn c++ data structuresmidtushar
 
Data Structure -List Stack Queue
Data Structure -List Stack QueueData Structure -List Stack Queue
Data Structure -List Stack Queuesurya pandian
 
Data structure lecture 3
Data structure lecture 3Data structure lecture 3
Data structure lecture 3Kumar
 
Lecture 13 data structures and algorithms
Lecture 13 data structures and algorithmsLecture 13 data structures and algorithms
Lecture 13 data structures and algorithmsAakash deep Singhal
 
Data structures Lecture no.6
Data structures Lecture no.6Data structures Lecture no.6
Data structures Lecture no.6AzharIqbal710687
 

Similaire à Arrays Data Structure (20)

DSA.pdf
DSA.pdfDSA.pdf
DSA.pdf
 
BCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHIBCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHI
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
Arrays
ArraysArrays
Arrays
 
CSE225_LEC3 (1).pptx
CSE225_LEC3 (1).pptxCSE225_LEC3 (1).pptx
CSE225_LEC3 (1).pptx
 
data structure and algorithm Array.pptx btech 2nd year
data structure and algorithm  Array.pptx btech 2nd yeardata structure and algorithm  Array.pptx btech 2nd year
data structure and algorithm Array.pptx btech 2nd year
 
COMPUTER PROGRAMMING UNIT 1 Lecture 5
COMPUTER PROGRAMMING UNIT 1 Lecture 5COMPUTER PROGRAMMING UNIT 1 Lecture 5
COMPUTER PROGRAMMING UNIT 1 Lecture 5
 
2.DS Array
2.DS Array2.DS Array
2.DS Array
 
Lecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsLecture 3 data structures and algorithms
Lecture 3 data structures and algorithms
 
Unit 7 sorting
Unit 7   sortingUnit 7   sorting
Unit 7 sorting
 
Unit III Version I.pptx
Unit III Version I.pptxUnit III Version I.pptx
Unit III Version I.pptx
 
Addressing Formulas for Sparse Matrices Using Column Major in 1D Arrays.pptx
Addressing Formulas for Sparse Matrices Using Column Major in 1D Arrays.pptxAddressing Formulas for Sparse Matrices Using Column Major in 1D Arrays.pptx
Addressing Formulas for Sparse Matrices Using Column Major in 1D Arrays.pptx
 
2. Array in Data Structure
2. Array in Data Structure2. Array in Data Structure
2. Array in Data Structure
 
Bcsl 033 solve assignment
Bcsl 033 solve assignmentBcsl 033 solve assignment
Bcsl 033 solve assignment
 
PPT Lecture 2.2.1 onn c++ data structures
PPT Lecture 2.2.1 onn c++ data structuresPPT Lecture 2.2.1 onn c++ data structures
PPT Lecture 2.2.1 onn c++ data structures
 
Data Structure -List Stack Queue
Data Structure -List Stack QueueData Structure -List Stack Queue
Data Structure -List Stack Queue
 
Data structure lecture 3
Data structure lecture 3Data structure lecture 3
Data structure lecture 3
 
Lecture 13 data structures and algorithms
Lecture 13 data structures and algorithmsLecture 13 data structures and algorithms
Lecture 13 data structures and algorithms
 
Unit 2 - Quick Sort.pptx
Unit 2 - Quick Sort.pptxUnit 2 - Quick Sort.pptx
Unit 2 - Quick Sort.pptx
 
Data structures Lecture no.6
Data structures Lecture no.6Data structures Lecture no.6
Data structures Lecture no.6
 

Plus de student

Logic Gates
Logic GatesLogic Gates
Logic Gatesstudent
 
Flipflops and Excitation tables of flipflops
Flipflops and Excitation tables of flipflopsFlipflops and Excitation tables of flipflops
Flipflops and Excitation tables of flipflopsstudent
 
Number Systems
Number SystemsNumber Systems
Number Systemsstudent
 
towers of hanoi
towers of hanoitowers of hanoi
towers of hanoistudent
 
header, circular and two way linked lists
header, circular and two way linked listsheader, circular and two way linked lists
header, circular and two way linked listsstudent
 
Number Systems
Number SystemsNumber Systems
Number Systemsstudent
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rulesstudent
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesstudent
 
animals colours numbers idioms
animals colours numbers idiomsanimals colours numbers idioms
animals colours numbers idiomsstudent
 
irregular verbs
irregular verbsirregular verbs
irregular verbsstudent
 
dc generator ece
dc generator ecedc generator ece
dc generator ecestudent
 
INDUCTION MOTOR
INDUCTION MOTORINDUCTION MOTOR
INDUCTION MOTORstudent
 
structure and union
structure and unionstructure and union
structure and unionstudent
 
storage class
storage classstorage class
storage classstudent
 
file handling1
file handling1file handling1
file handling1student
 
direct and indirect band gap
direct and indirect band gapdirect and indirect band gap
direct and indirect band gapstudent
 
hall effect
hall effecthall effect
hall effectstudent
 
optics chapter_07_solution_manual
optics chapter_07_solution_manualoptics chapter_07_solution_manual
optics chapter_07_solution_manualstudent
 
dyneins and kinesins
dyneins and kinesinsdyneins and kinesins
dyneins and kinesinsstudent
 
Structure and function of bacterial cells
Structure and function of bacterial cellsStructure and function of bacterial cells
Structure and function of bacterial cellsstudent
 

Plus de student (20)

Logic Gates
Logic GatesLogic Gates
Logic Gates
 
Flipflops and Excitation tables of flipflops
Flipflops and Excitation tables of flipflopsFlipflops and Excitation tables of flipflops
Flipflops and Excitation tables of flipflops
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
towers of hanoi
towers of hanoitowers of hanoi
towers of hanoi
 
header, circular and two way linked lists
header, circular and two way linked listsheader, circular and two way linked lists
header, circular and two way linked lists
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rules
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codes
 
animals colours numbers idioms
animals colours numbers idiomsanimals colours numbers idioms
animals colours numbers idioms
 
irregular verbs
irregular verbsirregular verbs
irregular verbs
 
dc generator ece
dc generator ecedc generator ece
dc generator ece
 
INDUCTION MOTOR
INDUCTION MOTORINDUCTION MOTOR
INDUCTION MOTOR
 
structure and union
structure and unionstructure and union
structure and union
 
storage class
storage classstorage class
storage class
 
file handling1
file handling1file handling1
file handling1
 
direct and indirect band gap
direct and indirect band gapdirect and indirect band gap
direct and indirect band gap
 
hall effect
hall effecthall effect
hall effect
 
optics chapter_07_solution_manual
optics chapter_07_solution_manualoptics chapter_07_solution_manual
optics chapter_07_solution_manual
 
dyneins and kinesins
dyneins and kinesinsdyneins and kinesins
dyneins and kinesins
 
Structure and function of bacterial cells
Structure and function of bacterial cellsStructure and function of bacterial cells
Structure and function of bacterial cells
 

Dernier

Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...gajnagarg
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...only4webmaster01
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...gajnagarg
 
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...gajnagarg
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...karishmasinghjnh
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNKTimothy Spann
 

Dernier (20)

Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
 
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 

Arrays Data Structure

  • 2. Linear Arrays A linear array is a list of finite number n of homogeneous data elements. Length = UB-LB+1 B: largest index B: smallest index
  • 3. Memory representation LOC(LA[K]): add of the element LA[K] of the array LA. LOC(LA[K])=Base(LA)+W(K-LB)
  • 4. Example AUTO which records the number of automobiles sold each year from 1932 to 1984. Base(Auto)=200 W=4 words per memory cell Find the add of element which store The info about sale in year 1965????
  • 5. Algorithm for traversing an array (Traversing a Linear Array) Here LA is a linear array with lower bound LB and upper bound UB. This algorithm traverses LA applying an operation PROCESS to each element of LA. 1. [Initialize counter] Set K := LB. 2. Repeat steps 3 and 4 while K <= UB. 3. [Visit element] Apply PROCESS to LA[K]. 4. [Increment counter] Set K := K + 1. [End of Step 2 loop.] . Exit.
  • 6. Algorithm for inserting an element into an array (Inserting into a linear array) INSERT (LA, N, K, ITEM) Here LA is a linear array with N elements and K is a positive integer such that K <= N. This algorithm inserts an element ITEM into the Kth position in LA. 1. [Initialize counter.] Set J := N. 2. Repeat Steps 3 and 4 while J >= K. 3. [Move Jth element downward.] Set LA[J+1] := LA[J]. 4. [Decrease counter.] Set J := J – 1. [End of Step 2 loop.] 5. [Insert element.] Set LA[K] := ITEM. 6. [Reset N.] Set N := N + 1. 7. Exit.
  • 7. Algorithm for deleting an element from an array (Deleting from a linear array) DELETE (LA, N, K, ITEM) Here LA is a linear array with N elements and K is a positive integer such that K <= N. This algorithm deletes the Kth element from LA. 1. Set ITEM := LA[K]. 2. Repeat for J = K to N - 1. [Move J + 1st element upward.] Set LA[J] := LA[J + 1]. [End of loop.] 3. [Reset the number N of elements in LA.] Set N := N - 1. 4. Exit.
  • 8. Algorithm for sorting an array (Bubble sort) (Bubble sort) BUBBLE (DATA, N) Here DATA is an array with N elements. This algorithm sorts the elements in DATA. 1. Repeat Steps 2 and 3 for K = 1 to N – 1. 2. Set PTR := 1. [Initialize pass pointer PTR.] 3. Repeat while PTR <= (N – K): [Executes pass.] (a) If DATA[PTR] > DATA[PTR + 1], then: Interchange DATA[PTR] and DATA[PTR + 1]. [End of If structure.] (b) Set PTR := PTR + 1. [End of inner loop.] [End of Step 1 outer loop.] 4. Exit.
  • 9. Example (Bubble sort) 32,51,27,85,66,23,13,57