SlideShare a Scribd company logo
1 of 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)

More Related Content

What's hot

Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in PythonDevashish Kumar
ย 
Python dictionary
Python dictionaryPython dictionary
Python dictionarySagar Kumar
ย 
Insertion sort
Insertion sortInsertion sort
Insertion sortalmaqboli
ย 
Data structure stack&queue basics
Data structure stack&queue   basicsData structure stack&queue   basics
Data structure stack&queue basicsSelvin Josy Bai Somu
ย 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdNimmi Weeraddana
ย 
Sorting in python
Sorting in python Sorting in python
Sorting in python Simplilearn
ย 
Heap sort
Heap sortHeap sort
Heap sortMohd Arif
ย 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure Janki Shah
ย 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure NUPOORAWSARMOL
ย 
2. Array in Data Structure
2. Array in Data Structure2. Array in Data Structure
2. Array in Data StructureMandeep Singh
ย 
Hashing in datastructure
Hashing in datastructureHashing in datastructure
Hashing in datastructurerajshreemuthiah
ย 
Data Structures Notes 2021
Data Structures Notes 2021Data Structures Notes 2021
Data Structures Notes 2021Sreedhar Chowdam
ย 
Queue data structure
Queue data structureQueue data structure
Queue data structureanooppjoseph
ย 
Data structures
Data structuresData structures
Data structuresPranav Gupta
ย 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1Kumar
ย 
Queue in Data Structure
Queue in Data StructureQueue in Data Structure
Queue in Data StructureMuhazzab Chouhadry
ย 
List and Dictionary in python
List and Dictionary in pythonList and Dictionary in python
List and Dictionary in pythonSangita Panchal
ย 
Bfs and Dfs
Bfs and DfsBfs and Dfs
Bfs and DfsMasud Parvaze
ย 

What's hot (20)

Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
ย 
Python dictionary
Python dictionaryPython dictionary
Python dictionary
ย 
Insertion sort
Insertion sortInsertion sort
Insertion sort
ย 
Data structure stack&queue basics
Data structure stack&queue   basicsData structure stack&queue   basics
Data structure stack&queue basics
ย 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
ย 
Sorting in python
Sorting in python Sorting in python
Sorting in python
ย 
Heap sort
Heap sortHeap sort
Heap sort
ย 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure
ย 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure
ย 
2. Array in Data Structure
2. Array in Data Structure2. Array in Data Structure
2. Array in Data Structure
ย 
Hashing in datastructure
Hashing in datastructureHashing in datastructure
Hashing in datastructure
ย 
Data Structures Notes 2021
Data Structures Notes 2021Data Structures Notes 2021
Data Structures Notes 2021
ย 
Arrays
ArraysArrays
Arrays
ย 
Queues
QueuesQueues
Queues
ย 
Queue data structure
Queue data structureQueue data structure
Queue data structure
ย 
Data structures
Data structuresData structures
Data structures
ย 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1
ย 
Queue in Data Structure
Queue in Data StructureQueue in Data Structure
Queue in Data Structure
ย 
List and Dictionary in python
List and Dictionary in pythonList and Dictionary in python
List and Dictionary in python
ย 
Bfs and Dfs
Bfs and DfsBfs and Dfs
Bfs and Dfs
ย 

Similar to 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
ย 
CSE225_LEC3 (1).pptx
CSE225_LEC3 (1).pptxCSE225_LEC3 (1).pptx
CSE225_LEC3 (1).pptxMamunurRasidAsif
ย 
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
ย 
Array linear data_structure_2 (1)
Array linear data_structure_2 (1)Array linear data_structure_2 (1)
Array linear data_structure_2 (1)eShikshak
ย 
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 7 sorting
Unit 7   sortingUnit 7   sorting
Unit 7 sortingkalyanineve
ย 
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
ย 
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
ย 
Unit 2 - Quick Sort.pptx
Unit 2 - Quick Sort.pptxUnit 2 - Quick Sort.pptx
Unit 2 - Quick Sort.pptxCO1IShwetaKidile
ย 
Data structures Lecture no.6
Data structures Lecture no.6Data structures Lecture no.6
Data structures Lecture no.6AzharIqbal710687
ย 
Array data structure
Array data structureArray data structure
Array data structureharsh112327
ย 

Similar to 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
ย 
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
ย 
Array linear data_structure_2 (1)
Array linear data_structure_2 (1)Array linear data_structure_2 (1)
Array linear data_structure_2 (1)
ย 
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
ย 
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
ย 
Array data structure
Array data structureArray data structure
Array data structure
ย 

More from 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
ย 

More from 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
ย 

Recently uploaded

Vadodara ๐Ÿ’‹ Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara ๐Ÿ’‹ Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara ๐Ÿ’‹ Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara ๐Ÿ’‹ Call Girl 7737669865 Call Girls in Vadodara Escort service book nowgargpaaro
ย 
Sonagachi * best call girls in Kolkata | โ‚น,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | โ‚น,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | โ‚น,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | โ‚น,9500 Pay Cash 8005736733 Free Home...HyderabadDolls
ย 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
ย 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...HyderabadDolls
ย 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
ย 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...nirzagarg
ย 
Statistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbersStatistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numberssuginr1
ย 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
ย 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...kumargunjan9515
ย 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfSayantanBiswas37
ย 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdfkhraisr
ย 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...kumargunjan9515
ย 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...Health
ย 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...HyderabadDolls
ย 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
ย 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...HyderabadDolls
ย 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...HyderabadDolls
ย 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraGovindSinghDasila
ย 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...gajnagarg
ย 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
ย 

Recently uploaded (20)

Vadodara ๐Ÿ’‹ Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara ๐Ÿ’‹ Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara ๐Ÿ’‹ Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara ๐Ÿ’‹ Call Girl 7737669865 Call Girls in Vadodara Escort service book now
ย 
Sonagachi * best call girls in Kolkata | โ‚น,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | โ‚น,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | โ‚น,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | โ‚น,9500 Pay Cash 8005736733 Free Home...
ย 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
ย 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
ย 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
ย 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
ย 
Statistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbersStatistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbers
ย 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
ย 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
ย 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
ย 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
ย 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
ย 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
ย 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
ย 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
ย 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
ย 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
ย 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
ย 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
ย 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
ย 

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