SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Welcome To My
Presentation
TOPIC:
Binary Search.
12 15 3533 42 45 51 7362 75 86 98
Binary search: target x =
62
v
L:
Mid:
R:
1
6
12
1 2 3 4 5 6 7 8 9 10 11
12
if v(Mid) < x
else if v(Mid) > x
Else if v(Mid) == x
Break;
So throw away the left
half…
L = Left
R = Right
V = Value
12 15 3533 42 45 51 7362 75 86 98v
L:
Mid:
R:
6
9
12
Binary search: target x = 62
1 2 3 4 5 6 7 8 9 10 11
12
if v(Mid) <x
else if v(Mid) > x
else if v(Mid) == x
Break;
So throw away the Right
half…
12 15 3533 42 45 51 7362 75 86 98v
L:
Mid:
R:
6
7
9
Binary search: target x = 62
1 2 3 4 5 6 7 8 9 10 11
12
if v(Mid) < x
else if v(Mid) > x
else if v(Mid) == x
Break;
So throw away the left
half…
12 15 3533 42 45 51 7362 75 86 98v
L:
Mid:
R:
7
8
9
Binary search: target x = 62
1 2 3 4 5 6 7 8 9 10 11
12
if v(Mid) < x
else if v(Mid) > x
else if v(Mid) == x
Break;
12 15 3533 42 45 51 7362 75 86 98v
Binary search: target x = 62
1 2 3 4 5 6 7 8 9 10 11
12
So finally we got our
target value when mid
value and x both fulfill
the condition
Binary search

Weitere ähnliche Inhalte

Was ist angesagt?

1.4 Quadratic Equations
1.4 Quadratic Equations1.4 Quadratic Equations
1.4 Quadratic Equationssmiller5
 
H Alg2 090409
H Alg2 090409H Alg2 090409
H Alg2 090409Mr. Smith
 
Algebra 1. 9.1 Solving equations review
Algebra 1.  9.1 Solving equations reviewAlgebra 1.  9.1 Solving equations review
Algebra 1. 9.1 Solving equations reviewdmatkeson21
 
Test 1 Review
Test 1 ReviewTest 1 Review
Test 1 Reviewsmiller5
 
CCA Chapter 4 HW Answers
CCA Chapter 4 HW AnswersCCA Chapter 4 HW Answers
CCA Chapter 4 HW AnswersJenny Hubbard
 
Analytic Geometry Period 1
Analytic Geometry Period 1Analytic Geometry Period 1
Analytic Geometry Period 1ingroy
 
Chapter 6 HW Answers
Chapter 6 HW AnswersChapter 6 HW Answers
Chapter 6 HW AnswersJenny Hubbard
 
Solving Quadratic Equations by Extracting Square Roots
Solving Quadratic Equations by Extracting Square RootsSolving Quadratic Equations by Extracting Square Roots
Solving Quadratic Equations by Extracting Square RootsFree Math Powerpoints
 
Quadratic equations lesson 3
Quadratic equations lesson 3Quadratic equations lesson 3
Quadratic equations lesson 3KathManarang
 
9.2 Matrices
9.2 Matrices9.2 Matrices
9.2 Matricessmiller5
 
P2 functions and equations from a graph questions
P2  functions and equations from a graph questionsP2  functions and equations from a graph questions
P2 functions and equations from a graph questionsRebecca Jones
 
Lesson 14: Equation of a Circle
Lesson 14: Equation of a CircleLesson 14: Equation of a Circle
Lesson 14: Equation of a CircleKevin Johnson
 
First Quarter - Chapter 2 - Quadratic Equation
First Quarter - Chapter 2 - Quadratic EquationFirst Quarter - Chapter 2 - Quadratic Equation
First Quarter - Chapter 2 - Quadratic EquationVer Louie Gautani
 
May 19, 2014
May 19, 2014May 19, 2014
May 19, 2014khyps13
 
Inverse matrix pptx
Inverse matrix pptxInverse matrix pptx
Inverse matrix pptxKimguan Tan
 

Was ist angesagt? (20)

1.4 Quadratic Equations
1.4 Quadratic Equations1.4 Quadratic Equations
1.4 Quadratic Equations
 
H Alg2 090409
H Alg2 090409H Alg2 090409
H Alg2 090409
 
Algebra 1. 9.1 Solving equations review
Algebra 1.  9.1 Solving equations reviewAlgebra 1.  9.1 Solving equations review
Algebra 1. 9.1 Solving equations review
 
Test 1 Review
Test 1 ReviewTest 1 Review
Test 1 Review
 
CCA Chapter 4 HW Answers
CCA Chapter 4 HW AnswersCCA Chapter 4 HW Answers
CCA Chapter 4 HW Answers
 
Analytic Geometry Period 1
Analytic Geometry Period 1Analytic Geometry Period 1
Analytic Geometry Period 1
 
Chapter 6 HW Answers
Chapter 6 HW AnswersChapter 6 HW Answers
Chapter 6 HW Answers
 
Solving Quadratic Equations by Extracting Square Roots
Solving Quadratic Equations by Extracting Square RootsSolving Quadratic Equations by Extracting Square Roots
Solving Quadratic Equations by Extracting Square Roots
 
Matrices
MatricesMatrices
Matrices
 
Quadratic equations lesson 3
Quadratic equations lesson 3Quadratic equations lesson 3
Quadratic equations lesson 3
 
Determinants
DeterminantsDeterminants
Determinants
 
Determinants
DeterminantsDeterminants
Determinants
 
9.2 Matrices
9.2 Matrices9.2 Matrices
9.2 Matrices
 
P2 functions and equations from a graph questions
P2  functions and equations from a graph questionsP2  functions and equations from a graph questions
P2 functions and equations from a graph questions
 
Lesson 14: Equation of a Circle
Lesson 14: Equation of a CircleLesson 14: Equation of a Circle
Lesson 14: Equation of a Circle
 
Factoring Quadratic Trinomials
Factoring Quadratic TrinomialsFactoring Quadratic Trinomials
Factoring Quadratic Trinomials
 
First Quarter - Chapter 2 - Quadratic Equation
First Quarter - Chapter 2 - Quadratic EquationFirst Quarter - Chapter 2 - Quadratic Equation
First Quarter - Chapter 2 - Quadratic Equation
 
CCA Chapter 7
CCA Chapter 7CCA Chapter 7
CCA Chapter 7
 
May 19, 2014
May 19, 2014May 19, 2014
May 19, 2014
 
Inverse matrix pptx
Inverse matrix pptxInverse matrix pptx
Inverse matrix pptx
 

Andere mochten auch

An introduction to application of zebra pattern for dissipation of heat in el...
An introduction to application of zebra pattern for dissipation of heat in el...An introduction to application of zebra pattern for dissipation of heat in el...
An introduction to application of zebra pattern for dissipation of heat in el...Sumit Dharmarao
 
Food Network - Presentation
Food Network - PresentationFood Network - Presentation
Food Network - PresentationDongqi Wang
 
Azure データサービスデザイン検討 (2015/10)
Azure データサービスデザイン検討 (2015/10)Azure データサービスデザイン検討 (2015/10)
Azure データサービスデザイン検討 (2015/10)Koichiro Sasaki
 
List Engineering Skills
List Engineering SkillsList Engineering Skills
List Engineering SkillsSV.CO
 
ユークリッド距離以外の距離で教師無しクラスタリング
ユークリッド距離以外の距離で教師無しクラスタリングユークリッド距離以外の距離で教師無しクラスタリング
ユークリッド距離以外の距離で教師無しクラスタリングMaruyama Tetsutaro
 
What is SaaS?
What is SaaS?What is SaaS?
What is SaaS?SV.CO
 
How to deploy & operate OpenStack Production
How to deploy & operate OpenStack ProductionHow to deploy & operate OpenStack Production
How to deploy & operate OpenStack ProductionVirtualTech Japan Inc.
 
Technologies for Data Analytics Platform
Technologies for Data Analytics PlatformTechnologies for Data Analytics Platform
Technologies for Data Analytics PlatformN Masahiro
 
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Amrinder Arora
 
TokyoR_21: テキストマイニングで見る『機動戦士ガンダム』
TokyoR_21: テキストマイニングで見る『機動戦士ガンダム』TokyoR_21: テキストマイニングで見る『機動戦士ガンダム』
TokyoR_21: テキストマイニングで見る『機動戦士ガンダム』Yuichiro Kobayashi
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchAmrinder Arora
 
CD(継続的デリバリー)手法を用いたサーバシステム構築の自動化 - OpenStack最新情報セミナー(2016年12月)
CD(継続的デリバリー)手法を用いたサーバシステム構築の自動化 - OpenStack最新情報セミナー(2016年12月)CD(継続的デリバリー)手法を用いたサーバシステム構築の自動化 - OpenStack最新情報セミナー(2016年12月)
CD(継続的デリバリー)手法を用いたサーバシステム構築の自動化 - OpenStack最新情報セミナー(2016年12月)VirtualTech Japan Inc.
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C v_jk
 
CET (Capture EveryThing)プロジェクトにおける機械学習・データマイニング最前線
CET (Capture EveryThing)プロジェクトにおける機械学習・データマイニング最前線CET (Capture EveryThing)プロジェクトにおける機械学習・データマイニング最前線
CET (Capture EveryThing)プロジェクトにおける機械学習・データマイニング最前線Recruit Lifestyle Co., Ltd.
 
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell ScruggsOrchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell ScruggsCloud Native Day Tel Aviv
 
Prospecting drip email campaign
Prospecting drip email campaignProspecting drip email campaign
Prospecting drip email campaignYesware
 

Andere mochten auch (20)

Monuments
MonumentsMonuments
Monuments
 
02 offline file
02 offline file02 offline file
02 offline file
 
An introduction to application of zebra pattern for dissipation of heat in el...
An introduction to application of zebra pattern for dissipation of heat in el...An introduction to application of zebra pattern for dissipation of heat in el...
An introduction to application of zebra pattern for dissipation of heat in el...
 
Food Network - Presentation
Food Network - PresentationFood Network - Presentation
Food Network - Presentation
 
Azure データサービスデザイン検討 (2015/10)
Azure データサービスデザイン検討 (2015/10)Azure データサービスデザイン検討 (2015/10)
Azure データサービスデザイン検討 (2015/10)
 
Spark summit 2016 recap
Spark summit 2016 recapSpark summit 2016 recap
Spark summit 2016 recap
 
List Engineering Skills
List Engineering SkillsList Engineering Skills
List Engineering Skills
 
ユークリッド距離以外の距離で教師無しクラスタリング
ユークリッド距離以外の距離で教師無しクラスタリングユークリッド距離以外の距離で教師無しクラスタリング
ユークリッド距離以外の距離で教師無しクラスタリング
 
What is SaaS?
What is SaaS?What is SaaS?
What is SaaS?
 
How to deploy & operate OpenStack Production
How to deploy & operate OpenStack ProductionHow to deploy & operate OpenStack Production
How to deploy & operate OpenStack Production
 
Technologies for Data Analytics Platform
Technologies for Data Analytics PlatformTechnologies for Data Analytics Platform
Technologies for Data Analytics Platform
 
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
 
DBTS2015_B35_SQLServer2016
DBTS2015_B35_SQLServer2016DBTS2015_B35_SQLServer2016
DBTS2015_B35_SQLServer2016
 
TokyoR_21: テキストマイニングで見る『機動戦士ガンダム』
TokyoR_21: テキストマイニングで見る『機動戦士ガンダム』TokyoR_21: テキストマイニングで見る『機動戦士ガンダム』
TokyoR_21: テキストマイニングで見る『機動戦士ガンダム』
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
 
CD(継続的デリバリー)手法を用いたサーバシステム構築の自動化 - OpenStack最新情報セミナー(2016年12月)
CD(継続的デリバリー)手法を用いたサーバシステム構築の自動化 - OpenStack最新情報セミナー(2016年12月)CD(継続的デリバリー)手法を用いたサーバシステム構築の自動化 - OpenStack最新情報セミナー(2016年12月)
CD(継続的デリバリー)手法を用いたサーバシステム構築の自動化 - OpenStack最新情報セミナー(2016年12月)
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
CET (Capture EveryThing)プロジェクトにおける機械学習・データマイニング最前線
CET (Capture EveryThing)プロジェクトにおける機械学習・データマイニング最前線CET (Capture EveryThing)プロジェクトにおける機械学習・データマイニング最前線
CET (Capture EveryThing)プロジェクトにおける機械学習・データマイニング最前線
 
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell ScruggsOrchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
 
Prospecting drip email campaign
Prospecting drip email campaignProspecting drip email campaign
Prospecting drip email campaign
 

Kürzlich hochgeladen

Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 

Kürzlich hochgeladen (20)

Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 

Binary search

  • 3. 12 15 3533 42 45 51 7362 75 86 98 Binary search: target x = 62 v L: Mid: R: 1 6 12 1 2 3 4 5 6 7 8 9 10 11 12 if v(Mid) < x else if v(Mid) > x Else if v(Mid) == x Break; So throw away the left half… L = Left R = Right V = Value
  • 4. 12 15 3533 42 45 51 7362 75 86 98v L: Mid: R: 6 9 12 Binary search: target x = 62 1 2 3 4 5 6 7 8 9 10 11 12 if v(Mid) <x else if v(Mid) > x else if v(Mid) == x Break; So throw away the Right half…
  • 5. 12 15 3533 42 45 51 7362 75 86 98v L: Mid: R: 6 7 9 Binary search: target x = 62 1 2 3 4 5 6 7 8 9 10 11 12 if v(Mid) < x else if v(Mid) > x else if v(Mid) == x Break; So throw away the left half…
  • 6. 12 15 3533 42 45 51 7362 75 86 98v L: Mid: R: 7 8 9 Binary search: target x = 62 1 2 3 4 5 6 7 8 9 10 11 12 if v(Mid) < x else if v(Mid) > x else if v(Mid) == x Break;
  • 7. 12 15 3533 42 45 51 7362 75 86 98v Binary search: target x = 62 1 2 3 4 5 6 7 8 9 10 11 12 So finally we got our target value when mid value and x both fulfill the condition