SlideShare a Scribd company logo
1 of 19
Muhammad
Aslam
Bs(Computer science)#2 Pathan
2k13/cse/26
 Is a functions which we use to
measure
Time,Space,and Check Efficiency of
the any Algorithms(Data Structure).
 There are three cases to measure the
algorithm in linear search
 Best case
 Average case
 Worst case
 Linear search is a technique in which
Items can be find sequentially or one by
one from data element.
 Find 55 number
x=n+1
Start
11 12 33 44 55 65
0 1 2 3 4 5 6 7
 The term best-case performance is used to
best case for a simple linear search on a
list occurs when the desired element is
the first element of the list.
 For example
 Find 11 c(n)=1
11 22 33 44 55 66 77 88
 Expected value of function
Find 76 c(n)=1/n
Start
Item not found
23 45 55 67 69 76 80 90
0 1 2 3 4 5 6 7
 Expected value of function
Find 76 c(n)=1/n
Start
Item not found
23 45 55 67 69 76 80 90
0 1 2 3 4 5 6 7
 Expected value of function
Find 76 c(n)=1/n
Start
Item not found
23 45 55 67 69 76 80 90
0 1 2 3 4 5 6 7
 Expected value of function
Find 76 c(n)=1/n
Start
Item not found
23 45 55 67 69 76 80 90
0 1 2 3 4 5 6 7
 Expected value of function
Find 76 c(n)=1/n
Start
Item not found
23 45 55 67 69 76 80 90
0 1 2 3 4 5 6 7
 Expected value of function
Find 76 c(n)=1/n
Start
Item found x={5}=76
23 45 55 67 69 76 80 90
0 1 2 3 4 5 6 7
 Binary search is a searching technique can be
search by the dividing the array of data
element from the Mid portion
 Formula= Mid int(Beg + End)/2
BEG MID END
0 1 2 3 4 5 6 7
10 11 12 23 24 35 36 45
 Find the number 37 from this array?
 X=37
Divided by Mid
Now formula=int (mid + end)/2
int (0+8)/2=4
0 1 2 3 4 5 6 7 8
10 37 12 23 24 35 36 45 88
 There are three cases to measure the
algorithm in linear search
 Best case
 Average case
 Worst case
0 1 2 3 4 5 6 7 8
5 12 17 23 38 44 77 84 90
Find(38)
0 8 4
Int = (BEG+END)/2
0 1 2 3 4 5 6 7 8
5 12 17 23 38 44 77 84 90
38<44 Low=Mid+1=5
Find(44)
0 8 4
Int = (BEG+END)/2
0 1 2 3 4 5 6 7 8
5 12 17 23 38 44 77 84 90
38<44 Low=Mid+1=5
Find(90)
0 8 4
Int = (BEG+END)/2
Thank You Very Much
Have
A Nice
Day

More Related Content

What's hot

Trigonometric, hyperbolic functions with invers and sum function
Trigonometric, hyperbolic functions with invers and sum functionTrigonometric, hyperbolic functions with invers and sum function
Trigonometric, hyperbolic functions with invers and sum functionDlearAhmad
 
Merge sort analysis and its real time applications
Merge sort analysis and its real time applicationsMerge sort analysis and its real time applications
Merge sort analysis and its real time applicationsyazad dumasia
 
Error Finding in Numerical method
Error Finding in Numerical methodError Finding in Numerical method
Error Finding in Numerical methodFazle Rabbi Ador
 
General Mathematics - Intercepts of Rational Functions
General Mathematics - Intercepts of Rational FunctionsGeneral Mathematics - Intercepts of Rational Functions
General Mathematics - Intercepts of Rational FunctionsJuan Miguel Palero
 
Greatest integer
Greatest integerGreatest integer
Greatest integerdmidgette
 
Approximation and error
Approximation and errorApproximation and error
Approximation and errorrubenarismendi
 
Linear and Binary Search
Linear and Binary SearchLinear and Binary Search
Linear and Binary SearchWinNie Sjr
 
Algorithm for Hungarian Method of Assignment
Algorithm for Hungarian Method of AssignmentAlgorithm for Hungarian Method of Assignment
Algorithm for Hungarian Method of AssignmentRaja Adapa
 
Unit 6 input modeling
Unit 6 input modeling Unit 6 input modeling
Unit 6 input modeling raksharao
 
Curve fitting
Curve fittingCurve fitting
Curve fittingdusan4rs
 
Implementing Merge Sort
Implementing Merge SortImplementing Merge Sort
Implementing Merge Sortsmita gupta
 
Honor's portfolio graphic organizer
Honor's portfolio graphic organizerHonor's portfolio graphic organizer
Honor's portfolio graphic organizerbbwilks
 

What's hot (19)

Quick sort demo
Quick sort demoQuick sort demo
Quick sort demo
 
Trigonometric, hyperbolic functions with invers and sum function
Trigonometric, hyperbolic functions with invers and sum functionTrigonometric, hyperbolic functions with invers and sum function
Trigonometric, hyperbolic functions with invers and sum function
 
Merge sort analysis and its real time applications
Merge sort analysis and its real time applicationsMerge sort analysis and its real time applications
Merge sort analysis and its real time applications
 
Error Finding in Numerical method
Error Finding in Numerical methodError Finding in Numerical method
Error Finding in Numerical method
 
General Mathematics - Intercepts of Rational Functions
General Mathematics - Intercepts of Rational FunctionsGeneral Mathematics - Intercepts of Rational Functions
General Mathematics - Intercepts of Rational Functions
 
Hprec2 1
Hprec2 1Hprec2 1
Hprec2 1
 
R time series analysis
R   time series analysisR   time series analysis
R time series analysis
 
Linear and Bianry search
Linear and Bianry searchLinear and Bianry search
Linear and Bianry search
 
Greatest integer
Greatest integerGreatest integer
Greatest integer
 
Approximation and error
Approximation and errorApproximation and error
Approximation and error
 
L 14-ct1120
L 14-ct1120L 14-ct1120
L 14-ct1120
 
Linear and Binary Search
Linear and Binary SearchLinear and Binary Search
Linear and Binary Search
 
Chap08
Chap08Chap08
Chap08
 
Algorithm for Hungarian Method of Assignment
Algorithm for Hungarian Method of AssignmentAlgorithm for Hungarian Method of Assignment
Algorithm for Hungarian Method of Assignment
 
Unit 6 input modeling
Unit 6 input modeling Unit 6 input modeling
Unit 6 input modeling
 
Curve fitting
Curve fittingCurve fitting
Curve fitting
 
Application of Stack, Link list , and Queue in Programming .
Application of Stack, Link list , and Queue in Programming .Application of Stack, Link list , and Queue in Programming .
Application of Stack, Link list , and Queue in Programming .
 
Implementing Merge Sort
Implementing Merge SortImplementing Merge Sort
Implementing Merge Sort
 
Honor's portfolio graphic organizer
Honor's portfolio graphic organizerHonor's portfolio graphic organizer
Honor's portfolio graphic organizer
 

Viewers also liked

Evaluation Question 1
Evaluation Question 1Evaluation Question 1
Evaluation Question 1sanj96
 
La gestion consular (2014)
La gestion consular (2014)La gestion consular (2014)
La gestion consular (2014)Jorge Rivera
 
19 algorithms-and-complexity-110627100203-phpapp02
19 algorithms-and-complexity-110627100203-phpapp0219 algorithms-and-complexity-110627100203-phpapp02
19 algorithms-and-complexity-110627100203-phpapp02Muhammad Aslam
 
diapositiva de creaciòn de un blog
diapositiva de creaciòn de un blogdiapositiva de creaciòn de un blog
diapositiva de creaciòn de un blogAsury1993
 
Algebra bl 16-04-2014
Algebra bl 16-04-2014Algebra bl 16-04-2014
Algebra bl 16-04-2014nik_gkoutz
 
Michael jackson
Michael jacksonMichael jackson
Michael jacksonsanj96
 
Audience research
Audience researchAudience research
Audience researchprav2405
 
新入社員へのメッセージ
新入社員へのメッセージ新入社員へのメッセージ
新入社員へのメッセージ哲也 平嶋
 
Cyber crime journal by central detective training school
Cyber crime journal by central detective training schoolCyber crime journal by central detective training school
Cyber crime journal by central detective training schoolBivas Chatterjee
 
Ap convention anahiem 2014 2
Ap convention anahiem 2014 2Ap convention anahiem 2014 2
Ap convention anahiem 2014 2Jorge Rivera
 
Varying Sentence Structure
Varying Sentence StructureVarying Sentence Structure
Varying Sentence StructureConnie Stan
 
Police Sytem in India: good or bad
Police Sytem in India: good or badPolice Sytem in India: good or bad
Police Sytem in India: good or baddev2avi
 
Temperature homeostasis
Temperature homeostasisTemperature homeostasis
Temperature homeostasisKimberley Wee
 

Viewers also liked (18)

Barátom a víz
Barátom a víz Barátom a víz
Barátom a víz
 
ACTIVIDAD 8
ACTIVIDAD 8ACTIVIDAD 8
ACTIVIDAD 8
 
Evaluation Question 1
Evaluation Question 1Evaluation Question 1
Evaluation Question 1
 
La gestion consular (2014)
La gestion consular (2014)La gestion consular (2014)
La gestion consular (2014)
 
Barátom a víz
Barátom a vízBarátom a víz
Barátom a víz
 
19 algorithms-and-complexity-110627100203-phpapp02
19 algorithms-and-complexity-110627100203-phpapp0219 algorithms-and-complexity-110627100203-phpapp02
19 algorithms-and-complexity-110627100203-phpapp02
 
diapositiva de creaciòn de un blog
diapositiva de creaciòn de un blogdiapositiva de creaciòn de un blog
diapositiva de creaciòn de un blog
 
Algebra bl 16-04-2014
Algebra bl 16-04-2014Algebra bl 16-04-2014
Algebra bl 16-04-2014
 
Michael jackson
Michael jacksonMichael jackson
Michael jackson
 
Audience research
Audience researchAudience research
Audience research
 
ugc
ugcugc
ugc
 
新入社員へのメッセージ
新入社員へのメッセージ新入社員へのメッセージ
新入社員へのメッセージ
 
Cyber crime journal by central detective training school
Cyber crime journal by central detective training schoolCyber crime journal by central detective training school
Cyber crime journal by central detective training school
 
Ap convention anahiem 2014 2
Ap convention anahiem 2014 2Ap convention anahiem 2014 2
Ap convention anahiem 2014 2
 
Varying Sentence Structure
Varying Sentence StructureVarying Sentence Structure
Varying Sentence Structure
 
Pithanotites
PithanotitesPithanotites
Pithanotites
 
Police Sytem in India: good or bad
Police Sytem in India: good or badPolice Sytem in India: good or bad
Police Sytem in India: good or bad
 
Temperature homeostasis
Temperature homeostasisTemperature homeostasis
Temperature homeostasis
 

Similar to Measure Algorithm Efficiency Linear Binary Search

Similar to Measure Algorithm Efficiency Linear Binary Search (20)

UNIT V.docx
UNIT V.docxUNIT V.docx
UNIT V.docx
 
UNIT IV -Data Structures.pdf
UNIT IV -Data Structures.pdfUNIT IV -Data Structures.pdf
UNIT IV -Data Structures.pdf
 
Searching
SearchingSearching
Searching
 
IRJET- A Survey on Different Searching Algorithms
IRJET- A Survey on Different Searching AlgorithmsIRJET- A Survey on Different Searching Algorithms
IRJET- A Survey on Different Searching Algorithms
 
Lecture3b searching
Lecture3b searchingLecture3b searching
Lecture3b searching
 
Chapter 4: basic search algorithms data structure
Chapter 4: basic search algorithms data structureChapter 4: basic search algorithms data structure
Chapter 4: basic search algorithms data structure
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to Algorithms
 
Distance Sort
Distance SortDistance Sort
Distance Sort
 
Bs,qs,divide and conquer 1
Bs,qs,divide and conquer 1Bs,qs,divide and conquer 1
Bs,qs,divide and conquer 1
 
Lect-2.pptx
Lect-2.pptxLect-2.pptx
Lect-2.pptx
 
Cis435 week04
Cis435 week04Cis435 week04
Cis435 week04
 
Chapter 11 - Sorting and Searching
Chapter 11 - Sorting and SearchingChapter 11 - Sorting and Searching
Chapter 11 - Sorting and Searching
 
Unit 8 searching and hashing
Unit   8 searching and hashingUnit   8 searching and hashing
Unit 8 searching and hashing
 
UNEC__1683196273.pptx
UNEC__1683196273.pptxUNEC__1683196273.pptx
UNEC__1683196273.pptx
 
Sorting Methods.pptx
Sorting Methods.pptxSorting Methods.pptx
Sorting Methods.pptx
 
Algorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsAlgorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching Algorithms
 
Chapter3.pptx
Chapter3.pptxChapter3.pptx
Chapter3.pptx
 
Lecture3a sorting
Lecture3a sortingLecture3a sorting
Lecture3a sorting
 
Unit ii divide and conquer -1
Unit ii divide and conquer -1Unit ii divide and conquer -1
Unit ii divide and conquer -1
 
21-algorithms (1).ppt
21-algorithms (1).ppt21-algorithms (1).ppt
21-algorithms (1).ppt
 

Recently uploaded

100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 

Recently uploaded (20)

100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 

Measure Algorithm Efficiency Linear Binary Search

  • 2.
  • 3.  Is a functions which we use to measure Time,Space,and Check Efficiency of the any Algorithms(Data Structure).
  • 4.  There are three cases to measure the algorithm in linear search  Best case  Average case  Worst case
  • 5.  Linear search is a technique in which Items can be find sequentially or one by one from data element.  Find 55 number x=n+1 Start 11 12 33 44 55 65 0 1 2 3 4 5 6 7
  • 6.  The term best-case performance is used to best case for a simple linear search on a list occurs when the desired element is the first element of the list.  For example  Find 11 c(n)=1 11 22 33 44 55 66 77 88
  • 7.  Expected value of function Find 76 c(n)=1/n Start Item not found 23 45 55 67 69 76 80 90 0 1 2 3 4 5 6 7
  • 8.  Expected value of function Find 76 c(n)=1/n Start Item not found 23 45 55 67 69 76 80 90 0 1 2 3 4 5 6 7
  • 9.  Expected value of function Find 76 c(n)=1/n Start Item not found 23 45 55 67 69 76 80 90 0 1 2 3 4 5 6 7
  • 10.  Expected value of function Find 76 c(n)=1/n Start Item not found 23 45 55 67 69 76 80 90 0 1 2 3 4 5 6 7
  • 11.  Expected value of function Find 76 c(n)=1/n Start Item not found 23 45 55 67 69 76 80 90 0 1 2 3 4 5 6 7
  • 12.  Expected value of function Find 76 c(n)=1/n Start Item found x={5}=76 23 45 55 67 69 76 80 90 0 1 2 3 4 5 6 7
  • 13.  Binary search is a searching technique can be search by the dividing the array of data element from the Mid portion  Formula= Mid int(Beg + End)/2 BEG MID END 0 1 2 3 4 5 6 7 10 11 12 23 24 35 36 45
  • 14.  Find the number 37 from this array?  X=37 Divided by Mid Now formula=int (mid + end)/2 int (0+8)/2=4 0 1 2 3 4 5 6 7 8 10 37 12 23 24 35 36 45 88
  • 15.  There are three cases to measure the algorithm in linear search  Best case  Average case  Worst case
  • 16. 0 1 2 3 4 5 6 7 8 5 12 17 23 38 44 77 84 90 Find(38) 0 8 4 Int = (BEG+END)/2
  • 17. 0 1 2 3 4 5 6 7 8 5 12 17 23 38 44 77 84 90 38<44 Low=Mid+1=5 Find(44) 0 8 4 Int = (BEG+END)/2
  • 18. 0 1 2 3 4 5 6 7 8 5 12 17 23 38 44 77 84 90 38<44 Low=Mid+1=5 Find(90) 0 8 4 Int = (BEG+END)/2
  • 19. Thank You Very Much Have A Nice Day