SlideShare a Scribd company logo
1 of 61
Made By: Ms. Archika Bhatia ARRAYS
WHAT IS AN ARRAY ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
NEED FOR AN ARRAY ,[object Object],[object Object],[object Object]
[object Object],[object Object],TYPES OF ARRAYS Base type of array Name of array No. of elements that can be stored: Can be a integer value without the sign
Creating an Array ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Memory Representation of Single Dimension Array ,[object Object],Arr [ 0 ]  Arr [ 1 ]  Arr [ 2 ]  Arr [ 3 ]  Arr [ 4 ]  5016  5012 5008  5004  5000  Total Memory requirement is : size of ( type ) * size of array 4 * 5  = 20 bytes
ARRAY INITIALISATION ,[object Object],[object Object]
UNSIZED ARRAY INITIALISATION ,[object Object],[object Object]
Program to count the no. of employees earning more than Rs. 1 lakh per annum. Monthly salaries of 10 employees are given. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Passing arrays in a function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WAP to input 10 numbers in an array and replace all even no.s by 0 and odd no.s by 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WAP to input 10 numbers in an array and replace all even no.s by 0 and odd no.s by 1 using functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WAP to find the largest and smallest no. in an array of 10 elements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PRACTICE QUESTIONS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Give the output of the following: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
output ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Give the output of the following: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Give the output ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Find errors in the following program code: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Find errors in the following program code: (  Assume header files included ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Find errors in the following program code: (  Assume header files included ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Find errors in the following program code: (  Assume header files included ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Find errors in the following program code: (  Assume header files included ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SEARCHING FOR AN ELEMENT IN AN ARRAY ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Function for Linear Searching
Search for the element using Linear Search and count the no. of times the element occurs in the array. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Binary Search method ,[object Object],[object Object],[object Object],[object Object],[object Object],m f m f l l l f f m l m l Note:  need to check f < = l
[object Object],[object Object],[object Object],[object Object],[object Object],m l l f m f l f m l
[object Object],[object Object],[object Object],[object Object],[object Object],f m l l f m f l m
INSERTING AN ELEMENT IN AN ARRAY ,[object Object],[object Object],[object Object],[object Object],Insert new element at the space created here. POS VALUE 12 13 12 10 8 7 6 6 5 4 3 2 1 0
DELETING AN ELEMENT IN AN ARRAY ,[object Object],[object Object],[object Object],[object Object],Insert 0 at the empty space created here. POS VALUE 6 5 4 3 2 1 0 12 13 12 10 8 7 6
SORTING ,[object Object],[object Object],[object Object],[object Object],[object Object]
BUBBLE SORT S NS NS S S PASS - I 9 5 6 2 4 3 5 9 6 2 4 3 5 6 9 2 4 3 5 6 2 9 4 3 5 6 2 9 4 3 5 6 2 9 4 3
BUBBLE SORT NS S NS S NS PASS - II 9 6 5 4 2 3 9 6 5 4 2 3 9 5 6 4 2 3 9 5 6 4 2 3 9 5 6 2 4 3 9 5 6 2 4 3
BUBBLE SORT NS NS S NS NS PASS - III 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 2 3
BUBBLE SORT NS NS NS NS NS PASS - IV 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2
EXCHANGE SELECTION SORT UNSORTED smallest First element of unsorted SORTED UNSORTED SORTED SORTED UNSORTED UNSORTED SORTED UNSORTED SORTED UNSORTED 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 5 6 9 4 3 2 5 6 4 9 3 2 5 6 3 9 4 2 5 6 2 9 4 3
INSERTION SORT UNSORTED First element of unsorted SORTED UNSORTED SORTED SORTED UNSORTED UNSORTED SORTED UNSORTED SORTED SORTED Find the correct place for the element and keep shifting the elements to the right. 8 7 5 3 2 2 5 8 7 3 2 2 5 2 8 7 3 2 5 2 2 8 7 3 5 2 2 3 8 7 5 2 2 3 8 7
MERGING OF TWO ARRAYS INTO A SINGLE ARRAY ,[object Object],[object Object],STEP - I 15 9 6 5 3 B  (elements) 4 3 2 1 0 B  (pos) 15 13 12 8 7 3 2 A  (elements) 6 5 4 3 2 1 0 A  (pos) C  (elements) C  (pos) 2 11 10 9 8 7 6 5 4 3 2 1 0
MUTLIDIMENSIONAL ARRAY ,[object Object],[object Object],[object Object],[object Object],[object Object]
ARRAY DECLARATION ,[object Object],[object Object],rows columns ( 1, 2 ) ( 1, 1 ) ( 1, 0 ) 1 ( 0, 2 ) ( 0 , 1 ) ( 0, 0 ) 0 2 1 0
UNSIZED ARRAY INITIALISATION ,[object Object],[object Object]
ADDRESS CALCULATION OF 1DA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ADDRESS CALCULATION OF 2DA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Given Array Row Major Implementation Column Major Implementation 8 7 2 6 5 3 8 7 2 6 5 3 8 6 7 5 2 3
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ADDRESS CALCULATION OF 2DA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MULTIPLICATION OF TWO MATRICES ,[object Object],* A[3][2] B[2][4] 3 (2,1) 2 (2,0) 1 (1,1) 4 (1,0) 6 (0,1) 5 (0,0) 1 (1,3) 6 (1,2) 4 (1,1) 5 (1,0) 0 (0,3) 1 (0,2) 3 (0,1) 2 (0,0)
[object Object],* A[3][2] B[2][4] C[3][4] 3 (2,1) 2 (2,0) 1 (1,1) 4 (1,0) 6 (0,1) 5 (0,0) 1 (1,3) 6 (1,2) 4 (1,1) 5 (1,0) 0 (0,3) 1 (0,2) 3 (0,1) 2 (0,0) 2*0 + 3*1 2*1 + 3*6 2*3 + 3*4 2*2 + 3*5 4*0 + 1*1 4*1 + 1*6 4*3 + 1*4 4*2 + 1*5 5*0 + 6*1 5*1 + 6*6 5*3 + 6*4 5*2 + 6*5
TRANSPOSE OF A MATRIX ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
LOWER TRIANGLE ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
UPPER TRIANGLE ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WAP to find row and column sum of a matrix. Create input, display and row_col_sum function for the same. IP OP 9 (2,2) 8 (2,1) 7 (2,0) 6 (1,2) 5 (1,1) 4 (1,0) 3 (0,2) 2 (0,1) 1 (0,0) 0 17 14 11 21 9 8 7 15 6 5 4 6 3 2 1

More Related Content

What's hot

What's hot (20)

Java - Collections framework
Java - Collections frameworkJava - Collections framework
Java - Collections framework
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
 
Two Dimensional Array
Two Dimensional ArrayTwo Dimensional Array
Two Dimensional Array
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
 
Java collections concept
Java collections conceptJava collections concept
Java collections concept
 
Array in c++
Array in c++Array in c++
Array in c++
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
 
Presentation on array
Presentation on array Presentation on array
Presentation on array
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
sparse matrix in data structure
sparse matrix in data structuresparse matrix in data structure
sparse matrix in data structure
 
Java swing
Java swingJava swing
Java swing
 
Arrays
ArraysArrays
Arrays
 
Python list
Python listPython list
Python list
 
Java Collections
Java  Collections Java  Collections
Java Collections
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
Linear search algorithm
Linear search algorithmLinear search algorithm
Linear search algorithm
 

Similar to Arrays

CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical filePranav Ghildiyal
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersTikal Knowledge
 
An Introduction to Part of C++ STL
An Introduction to Part of C++ STLAn Introduction to Part of C++ STL
An Introduction to Part of C++ STL乐群 陈
 
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdfarihantelehyb
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File Rahul Chugh
 
C++ Searching & Sorting5. Sort the following list using the select.pdf
C++ Searching & Sorting5. Sort the following list using the select.pdfC++ Searching & Sorting5. Sort the following list using the select.pdf
C++ Searching & Sorting5. Sort the following list using the select.pdfRahul04August
 
STL ALGORITHMS
STL ALGORITHMSSTL ALGORITHMS
STL ALGORITHMSfawzmasood
 
Data structure array
Data structure  arrayData structure  array
Data structure arrayMajidHamidAli
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxDIPESH30
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxAbhishek Tirkey
 

Similar to Arrays (20)

Arrays
ArraysArrays
Arrays
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 
DSA.pdf
DSA.pdfDSA.pdf
DSA.pdf
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
An Introduction to Part of C++ STL
An Introduction to Part of C++ STLAn Introduction to Part of C++ STL
An Introduction to Part of C++ STL
 
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File
 
02 arrays
02 arrays02 arrays
02 arrays
 
C programs
C programsC programs
C programs
 
Arrays
ArraysArrays
Arrays
 
DSA - Array.pptx
DSA - Array.pptxDSA - Array.pptx
DSA - Array.pptx
 
C++ Searching & Sorting5. Sort the following list using the select.pdf
C++ Searching & Sorting5. Sort the following list using the select.pdfC++ Searching & Sorting5. Sort the following list using the select.pdf
C++ Searching & Sorting5. Sort the following list using the select.pdf
 
STL ALGORITHMS
STL ALGORITHMSSTL ALGORITHMS
STL ALGORITHMS
 
Data structure array
Data structure  arrayData structure  array
Data structure array
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
 
C program
C programC program
C program
 
Code optimization
Code optimization Code optimization
Code optimization
 
Code optimization
Code optimization Code optimization
Code optimization
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 

More from archikabhatia

More from archikabhatia (10)

Computer network
Computer networkComputer network
Computer network
 
Structures
StructuresStructures
Structures
 
Wild Cards
Wild CardsWild Cards
Wild Cards
 
Console Io Operations
Console Io OperationsConsole Io Operations
Console Io Operations
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodology
 
Headerfiles
HeaderfilesHeaderfiles
Headerfiles
 
Computer Fundamentals
Computer FundamentalsComputer Fundamentals
Computer Fundamentals
 
Functions
FunctionsFunctions
Functions
 
Draw
DrawDraw
Draw
 
Cso Latest
Cso LatestCso Latest
Cso Latest
 

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Arrays

  • 1. Made By: Ms. Archika Bhatia ARRAYS
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40. BUBBLE SORT S NS NS S S PASS - I 9 5 6 2 4 3 5 9 6 2 4 3 5 6 9 2 4 3 5 6 2 9 4 3 5 6 2 9 4 3 5 6 2 9 4 3
  • 41. BUBBLE SORT NS S NS S NS PASS - II 9 6 5 4 2 3 9 6 5 4 2 3 9 5 6 4 2 3 9 5 6 4 2 3 9 5 6 2 4 3 9 5 6 2 4 3
  • 42. BUBBLE SORT NS NS S NS NS PASS - III 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 2 3
  • 43. BUBBLE SORT NS NS NS NS NS PASS - IV 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2
  • 44. EXCHANGE SELECTION SORT UNSORTED smallest First element of unsorted SORTED UNSORTED SORTED SORTED UNSORTED UNSORTED SORTED UNSORTED SORTED UNSORTED 9 6 5 4 3 2 9 6 5 4 3 2 9 6 5 4 3 2 5 6 9 4 3 2 5 6 4 9 3 2 5 6 3 9 4 2 5 6 2 9 4 3
  • 45. INSERTION SORT UNSORTED First element of unsorted SORTED UNSORTED SORTED SORTED UNSORTED UNSORTED SORTED UNSORTED SORTED SORTED Find the correct place for the element and keep shifting the elements to the right. 8 7 5 3 2 2 5 8 7 3 2 2 5 2 8 7 3 2 5 2 2 8 7 3 5 2 2 3 8 7 5 2 2 3 8 7
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52. Given Array Row Major Implementation Column Major Implementation 8 7 2 6 5 3 8 7 2 6 5 3 8 6 7 5 2 3
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61. WAP to find row and column sum of a matrix. Create input, display and row_col_sum function for the same. IP OP 9 (2,2) 8 (2,1) 7 (2,0) 6 (1,2) 5 (1,1) 4 (1,0) 3 (0,2) 2 (0,1) 1 (0,0) 0 17 14 11 21 9 8 7 15 6 5 4 6 3 2 1