SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
ALGORITHM BruteForceStringMatch (T[0.n1],P[0.m1]) //Implements brute-force string matching
I/Input: An array T[0.n1] of n characters representing a text and II an array P[0.m1] of m characters
representing a pattern //Output: The index of the first character in the text that starts a II matching
substring or -1 if the search is unsuccessful for i0 to nm do j0 while j<m and P[j]=T[i+j] do jj+1 if j=
m return i return -1

Weitere ähnliche Inhalte

Mehr von standly3

5 There are lots of types of proteins that transport molecu.pdf
5 There are lots of types of proteins that transport molecu.pdf5 There are lots of types of proteins that transport molecu.pdf
5 There are lots of types of proteins that transport molecu.pdfstandly3
 
Charles Schwab versus Andrew Cuomo Charles Schwab started th.pdf
Charles Schwab versus Andrew Cuomo Charles Schwab started th.pdfCharles Schwab versus Andrew Cuomo Charles Schwab started th.pdf
Charles Schwab versus Andrew Cuomo Charles Schwab started th.pdfstandly3
 
yi vizyon ifadeleri bir organizasyonun mevcut durumuyla bir.pdf
yi vizyon ifadeleri bir organizasyonun mevcut durumuyla bir.pdfyi vizyon ifadeleri bir organizasyonun mevcut durumuyla bir.pdf
yi vizyon ifadeleri bir organizasyonun mevcut durumuyla bir.pdfstandly3
 
1 Salomon v Salomon amp Co Ltd 1897 AC 22 davas u ilke .pdf
1 Salomon v Salomon amp Co Ltd 1897 AC 22 davas u ilke .pdf1 Salomon v Salomon amp Co Ltd 1897 AC 22 davas u ilke .pdf
1 Salomon v Salomon amp Co Ltd 1897 AC 22 davas u ilke .pdfstandly3
 
1 Log into the US Small Business Administration website a.pdf
1 Log into the US Small Business Administration website a.pdf1 Log into the US Small Business Administration website a.pdf
1 Log into the US Small Business Administration website a.pdfstandly3
 
2 Problem In a MIMO system Random Vectors XYN are relat.pdf
2 Problem In a MIMO system Random Vectors XYN are relat.pdf2 Problem In a MIMO system Random Vectors XYN are relat.pdf
2 Problem In a MIMO system Random Vectors XYN are relat.pdfstandly3
 
1 El sistema de evaluacin del desempeo de la escala de ca.pdf
1 El sistema de evaluacin del desempeo de la escala de ca.pdf1 El sistema de evaluacin del desempeo de la escala de ca.pdf
1 El sistema de evaluacin del desempeo de la escala de ca.pdfstandly3
 
xkf1i1nxi.pdf
xkf1i1nxi.pdfxkf1i1nxi.pdf
xkf1i1nxi.pdfstandly3
 
Why does the number of valence electrons matter The number .pdf
Why does the number of valence electrons matter The number .pdfWhy does the number of valence electrons matter The number .pdf
Why does the number of valence electrons matter The number .pdfstandly3
 
Which of the following best defines organizational behavior.pdf
Which of the following best defines organizational behavior.pdfWhich of the following best defines organizational behavior.pdf
Which of the following best defines organizational behavior.pdfstandly3
 
Week 2 Discussion Board please answer the following in this .pdf
Week 2 Discussion Board please answer the following in this .pdfWeek 2 Discussion Board please answer the following in this .pdf
Week 2 Discussion Board please answer the following in this .pdfstandly3
 
4 Compare how different molecules can diffuse across a pure.pdf
4 Compare how different molecules can diffuse across a pure.pdf4 Compare how different molecules can diffuse across a pure.pdf
4 Compare how different molecules can diffuse across a pure.pdfstandly3
 
Please help will thumbs up In the winter of 2019 in Wuhan.pdf
Please help will thumbs up In the winter of 2019 in Wuhan.pdfPlease help will thumbs up In the winter of 2019 in Wuhan.pdf
Please help will thumbs up In the winter of 2019 in Wuhan.pdfstandly3
 
Una inversin agresiva en anlisis de clientes representa el.pdf
Una inversin agresiva en anlisis de clientes representa el.pdfUna inversin agresiva en anlisis de clientes representa el.pdf
Una inversin agresiva en anlisis de clientes representa el.pdfstandly3
 
THINKPAIRSHARE Mirror scales are recessive in common car.pdf
THINKPAIRSHARE  Mirror scales are recessive in common car.pdfTHINKPAIRSHARE  Mirror scales are recessive in common car.pdf
THINKPAIRSHARE Mirror scales are recessive in common car.pdfstandly3
 
5 Ch7 Variation on 28 In cryptography the intended messag.pdf
5 Ch7 Variation on 28 In cryptography the intended messag.pdf5 Ch7 Variation on 28 In cryptography the intended messag.pdf
5 Ch7 Variation on 28 In cryptography the intended messag.pdfstandly3
 
Vaka 83 Model Aratrma Merkezi Vizyonu Rachel Adams byk.pdf
Vaka 83 Model Aratrma Merkezi Vizyonu  Rachel Adams byk.pdfVaka 83 Model Aratrma Merkezi Vizyonu  Rachel Adams byk.pdf
Vaka 83 Model Aratrma Merkezi Vizyonu Rachel Adams byk.pdfstandly3
 
The language with strings of the form 1n0n where is ngt0 c.pdf
The language with strings of the form 1n0n where is ngt0 c.pdfThe language with strings of the form 1n0n where is ngt0 c.pdf
The language with strings of the form 1n0n where is ngt0 c.pdfstandly3
 
Un organismo tiene las siguientes caractersticas pluricelu.pdf
Un organismo tiene las siguientes caractersticas pluricelu.pdfUn organismo tiene las siguientes caractersticas pluricelu.pdf
Un organismo tiene las siguientes caractersticas pluricelu.pdfstandly3
 
The following system call adds read permission for a process.pdf
The following system call adds read permission for a process.pdfThe following system call adds read permission for a process.pdf
The following system call adds read permission for a process.pdfstandly3
 

Mehr von standly3 (20)

5 There are lots of types of proteins that transport molecu.pdf
5 There are lots of types of proteins that transport molecu.pdf5 There are lots of types of proteins that transport molecu.pdf
5 There are lots of types of proteins that transport molecu.pdf
 
Charles Schwab versus Andrew Cuomo Charles Schwab started th.pdf
Charles Schwab versus Andrew Cuomo Charles Schwab started th.pdfCharles Schwab versus Andrew Cuomo Charles Schwab started th.pdf
Charles Schwab versus Andrew Cuomo Charles Schwab started th.pdf
 
yi vizyon ifadeleri bir organizasyonun mevcut durumuyla bir.pdf
yi vizyon ifadeleri bir organizasyonun mevcut durumuyla bir.pdfyi vizyon ifadeleri bir organizasyonun mevcut durumuyla bir.pdf
yi vizyon ifadeleri bir organizasyonun mevcut durumuyla bir.pdf
 
1 Salomon v Salomon amp Co Ltd 1897 AC 22 davas u ilke .pdf
1 Salomon v Salomon amp Co Ltd 1897 AC 22 davas u ilke .pdf1 Salomon v Salomon amp Co Ltd 1897 AC 22 davas u ilke .pdf
1 Salomon v Salomon amp Co Ltd 1897 AC 22 davas u ilke .pdf
 
1 Log into the US Small Business Administration website a.pdf
1 Log into the US Small Business Administration website a.pdf1 Log into the US Small Business Administration website a.pdf
1 Log into the US Small Business Administration website a.pdf
 
2 Problem In a MIMO system Random Vectors XYN are relat.pdf
2 Problem In a MIMO system Random Vectors XYN are relat.pdf2 Problem In a MIMO system Random Vectors XYN are relat.pdf
2 Problem In a MIMO system Random Vectors XYN are relat.pdf
 
1 El sistema de evaluacin del desempeo de la escala de ca.pdf
1 El sistema de evaluacin del desempeo de la escala de ca.pdf1 El sistema de evaluacin del desempeo de la escala de ca.pdf
1 El sistema de evaluacin del desempeo de la escala de ca.pdf
 
xkf1i1nxi.pdf
xkf1i1nxi.pdfxkf1i1nxi.pdf
xkf1i1nxi.pdf
 
Why does the number of valence electrons matter The number .pdf
Why does the number of valence electrons matter The number .pdfWhy does the number of valence electrons matter The number .pdf
Why does the number of valence electrons matter The number .pdf
 
Which of the following best defines organizational behavior.pdf
Which of the following best defines organizational behavior.pdfWhich of the following best defines organizational behavior.pdf
Which of the following best defines organizational behavior.pdf
 
Week 2 Discussion Board please answer the following in this .pdf
Week 2 Discussion Board please answer the following in this .pdfWeek 2 Discussion Board please answer the following in this .pdf
Week 2 Discussion Board please answer the following in this .pdf
 
4 Compare how different molecules can diffuse across a pure.pdf
4 Compare how different molecules can diffuse across a pure.pdf4 Compare how different molecules can diffuse across a pure.pdf
4 Compare how different molecules can diffuse across a pure.pdf
 
Please help will thumbs up In the winter of 2019 in Wuhan.pdf
Please help will thumbs up In the winter of 2019 in Wuhan.pdfPlease help will thumbs up In the winter of 2019 in Wuhan.pdf
Please help will thumbs up In the winter of 2019 in Wuhan.pdf
 
Una inversin agresiva en anlisis de clientes representa el.pdf
Una inversin agresiva en anlisis de clientes representa el.pdfUna inversin agresiva en anlisis de clientes representa el.pdf
Una inversin agresiva en anlisis de clientes representa el.pdf
 
THINKPAIRSHARE Mirror scales are recessive in common car.pdf
THINKPAIRSHARE  Mirror scales are recessive in common car.pdfTHINKPAIRSHARE  Mirror scales are recessive in common car.pdf
THINKPAIRSHARE Mirror scales are recessive in common car.pdf
 
5 Ch7 Variation on 28 In cryptography the intended messag.pdf
5 Ch7 Variation on 28 In cryptography the intended messag.pdf5 Ch7 Variation on 28 In cryptography the intended messag.pdf
5 Ch7 Variation on 28 In cryptography the intended messag.pdf
 
Vaka 83 Model Aratrma Merkezi Vizyonu Rachel Adams byk.pdf
Vaka 83 Model Aratrma Merkezi Vizyonu  Rachel Adams byk.pdfVaka 83 Model Aratrma Merkezi Vizyonu  Rachel Adams byk.pdf
Vaka 83 Model Aratrma Merkezi Vizyonu Rachel Adams byk.pdf
 
The language with strings of the form 1n0n where is ngt0 c.pdf
The language with strings of the form 1n0n where is ngt0 c.pdfThe language with strings of the form 1n0n where is ngt0 c.pdf
The language with strings of the form 1n0n where is ngt0 c.pdf
 
Un organismo tiene las siguientes caractersticas pluricelu.pdf
Un organismo tiene las siguientes caractersticas pluricelu.pdfUn organismo tiene las siguientes caractersticas pluricelu.pdf
Un organismo tiene las siguientes caractersticas pluricelu.pdf
 
The following system call adds read permission for a process.pdf
The following system call adds read permission for a process.pdfThe following system call adds read permission for a process.pdf
The following system call adds read permission for a process.pdf
 

Kürzlich hochgeladen

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Kürzlich hochgeladen (20)

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

ALGORITHM BruteForceStringMatch T0n1P0m1 Implemen.pdf

  • 1. ALGORITHM BruteForceStringMatch (T[0.n1],P[0.m1]) //Implements brute-force string matching I/Input: An array T[0.n1] of n characters representing a text and II an array P[0.m1] of m characters representing a pattern //Output: The index of the first character in the text that starts a II matching substring or -1 if the search is unsuccessful for i0 to nm do j0 while j<m and P[j]=T[i+j] do jj+1 if j= m return i return -1