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 (20)

deque and it applications
deque and it applicationsdeque and it applications
deque and it applications
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applications
 
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
 
Java Stack Data Structure.pptx
Java Stack Data Structure.pptxJava Stack Data Structure.pptx
Java Stack Data Structure.pptx
 
My lectures circular queue
My lectures circular queueMy lectures circular queue
My lectures circular queue
 
Array in c++
Array in c++Array in c++
Array in c++
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
Python tuple
Python   tuplePython   tuple
Python tuple
 
Stack
StackStack
Stack
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
 
Introduction to stack
Introduction to stackIntroduction to stack
Introduction to stack
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
 
Arrays and structures
Arrays and structuresArrays and structures
Arrays and structures
 
Tuple in python
Tuple in pythonTuple in python
Tuple in python
 
Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
sorting and its types
sorting and its typessorting and its types
sorting and its types
 
8 python data structure-1
8 python data structure-18 python data structure-1
8 python data structure-1
 

Similar to Arrays (20)

Arrays
ArraysArrays
Arrays
 
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
 

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

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

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