# We consider the following problem Suppose that you are give.pdf

We consider the following problem: Suppose that you are given a 0/1 string S of kind 1m0n, that is, it has m01 's at the beginning, followed by n00 's. Note that m and n are unknown to the algorithm, only k=m+n is known. Also note, that either m or n can be equal to zero, but not both. (a) [14 marks] Design a divide-and-conquer algorithm that finds the number of zeroes in S in time O(logk), where k=m+n. Assume that the input string S is given in an array S[1,,k]. Give a brief argument showing that your algorithm is correct. (b) [12 marks] Give an argument that your algorithm indeed has O(logk) running time, by formulating, explaining and solving an appropriate recurrence equation. Assume that each comparison or arithmetic operation takes constant time..

1 of 1

## Recommended

We discussed how defining macros in code is tedious and why .pdf
We discussed how defining macros in code is tedious and why .pdfDARSHANACHARYA13

We consider the exampie about two threads accessing a printe.pdf
We consider the exampie about two threads accessing a printe.pdfDARSHANACHARYA13

We ask you to perform the following calculations to determin.pdf
We ask you to perform the following calculations to determin.pdfDARSHANACHARYA13

We assume a function f is of the form ftk1nakkt where .pdf
We assume a function f is of the form ftk1nakkt where .pdfDARSHANACHARYA13

Wayne Corrugated Inc manufactures folding paperboard boxe.pdf
Wayne Corrugated Inc manufactures folding paperboard boxe.pdfDARSHANACHARYA13

We are planning to develop a system for A pediatrician clini.pdf
We are planning to develop a system for A pediatrician clini.pdfDARSHANACHARYA13

WCC Corporation has a 145000 net operating loss carryover .pdf
WCC Corporation has a 145000 net operating loss carryover .pdfDARSHANACHARYA13

We all know that the interpretation of coefficients in a sem.pdf
We all know that the interpretation of coefficients in a sem.pdfDARSHANACHARYA13

## More from DARSHANACHARYA13

Watch the videos below In these videos you will see the st.pdf
Watch the videos below In these videos you will see the st.pdfDARSHANACHARYA13

Waste Disposal Systems has an aftertax cost of debt of 90 p.pdf
Waste Disposal Systems has an aftertax cost of debt of 90 p.pdfDARSHANACHARYA13

Waste from the food ingested is eliminated via the colon and.pdf
Waste from the food ingested is eliminated via the colon and.pdfDARSHANACHARYA13

Warning This game is purely for educational purposes and do.pdf
Warning This game is purely for educational purposes and do.pdfDARSHANACHARYA13

WarmUp Check Your Understanding Fill in the blank with the.pdf
WarmUp Check Your Understanding Fill in the blank with the.pdfDARSHANACHARYA13

Walmartn Amazon ve dier evrimii perakendecilerle rekabet .pdf
Walmartn Amazon ve dier evrimii perakendecilerle rekabet .pdfDARSHANACHARYA13

Warren Buffett director ejecutivo del holding multinacional.pdf
Warren Buffett director ejecutivo del holding multinacional.pdfDARSHANACHARYA13

Walt Disney espera recibir una tarifa teatral de Mex16 mill.pdf
Walt Disney espera recibir una tarifa teatral de Mex16 mill.pdfDARSHANACHARYA13

WACC is 542 Firm Z has invested 4 million in marketing .pdf
WACC is 542 Firm Z has invested 4 million in marketing .pdfDARSHANACHARYA13

Walmart en todo el mundo Escuela de Negocios de Harvard Pr.pdf
Walmart en todo el mundo Escuela de Negocios de Harvard Pr.pdfDARSHANACHARYA13

Vulcan Flyovers offers scenic overfights of Mount Saint Hele.pdf
Vulcan Flyovers offers scenic overfights of Mount Saint Hele.pdfDARSHANACHARYA13

W them and Interference NOTE The mutant versions of these.pdf
W them and Interference NOTE The mutant versions of these.pdfDARSHANACHARYA13

Vulcan Flyovers offers scenic overflights of Mount Saint Hel.pdf
Vulcan Flyovers offers scenic overflights of Mount Saint Hel.pdfDARSHANACHARYA13

VSIM JOSEPHINE MORROW La reflexin est destinada a reforza.pdf
VSIM JOSEPHINE MORROW La reflexin est destinada a reforza.pdfDARSHANACHARYA13

Vincent Company supplies schools with floot matiresses to us.pdf
Vincent Company supplies schools with floot matiresses to us.pdfDARSHANACHARYA13

vs H1pp0 for some known quantity p001 Based on Questi.pdf
vs H1pp0 for some known quantity p001 Based on Questi.pdfDARSHANACHARYA13

Viviane performs a noncompartmental analysis She reports t.pdf
Viviane performs a noncompartmental analysis She reports t.pdfDARSHANACHARYA13

viguifcanon levei for al parte Tent the claim trat the teo .pdf
viguifcanon levei for al parte Tent the claim trat the teo .pdfDARSHANACHARYA13

Verdadero Falso 5_____ Las actividades de apoyo del sistem.pdf
Verdadero Falso 5_____ Las actividades de apoyo del sistem.pdfDARSHANACHARYA13

Victory Company uses weighted average process costing The c.pdf
Victory Company uses weighted average process costing The c.pdfDARSHANACHARYA13

### More from DARSHANACHARYA13(20)

Watch the videos below In these videos you will see the st.pdf
Watch the videos below In these videos you will see the st.pdf

Waste Disposal Systems has an aftertax cost of debt of 90 p.pdf
Waste Disposal Systems has an aftertax cost of debt of 90 p.pdf

Waste from the food ingested is eliminated via the colon and.pdf
Waste from the food ingested is eliminated via the colon and.pdf

Warning This game is purely for educational purposes and do.pdf
Warning This game is purely for educational purposes and do.pdf

WarmUp Check Your Understanding Fill in the blank with the.pdf
WarmUp Check Your Understanding Fill in the blank with the.pdf

Walmartn Amazon ve dier evrimii perakendecilerle rekabet .pdf
Walmartn Amazon ve dier evrimii perakendecilerle rekabet .pdf

Warren Buffett director ejecutivo del holding multinacional.pdf
Warren Buffett director ejecutivo del holding multinacional.pdf

Walt Disney espera recibir una tarifa teatral de Mex16 mill.pdf
Walt Disney espera recibir una tarifa teatral de Mex16 mill.pdf

WACC is 542 Firm Z has invested 4 million in marketing .pdf
WACC is 542 Firm Z has invested 4 million in marketing .pdf

Walmart en todo el mundo Escuela de Negocios de Harvard Pr.pdf
Walmart en todo el mundo Escuela de Negocios de Harvard Pr.pdf

Vulcan Flyovers offers scenic overfights of Mount Saint Hele.pdf
Vulcan Flyovers offers scenic overfights of Mount Saint Hele.pdf

W them and Interference NOTE The mutant versions of these.pdf
W them and Interference NOTE The mutant versions of these.pdf

Vulcan Flyovers offers scenic overflights of Mount Saint Hel.pdf
Vulcan Flyovers offers scenic overflights of Mount Saint Hel.pdf

VSIM JOSEPHINE MORROW La reflexin est destinada a reforza.pdf
VSIM JOSEPHINE MORROW La reflexin est destinada a reforza.pdf

Vincent Company supplies schools with floot matiresses to us.pdf
Vincent Company supplies schools with floot matiresses to us.pdf

vs H1pp0 for some known quantity p001 Based on Questi.pdf
vs H1pp0 for some known quantity p001 Based on Questi.pdf

Viviane performs a noncompartmental analysis She reports t.pdf
Viviane performs a noncompartmental analysis She reports t.pdf

viguifcanon levei for al parte Tent the claim trat the teo .pdf
viguifcanon levei for al parte Tent the claim trat the teo .pdf

Verdadero Falso 5_____ Las actividades de apoyo del sistem.pdf
Verdadero Falso 5_____ Las actividades de apoyo del sistem.pdf

Victory Company uses weighted average process costing The c.pdf
Victory Company uses weighted average process costing The c.pdf

2023 MAP Data Analysis - St. Louis Region
2023 MAP Data Analysis - St. Louis RegionThe Opportunity Trust

Advance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BDr. Mazin Mohamed alkathiri

Use integers to explore high and low places.pptx
Use integers to explore high and low places.pptxchristianmathematics

“ Importance of seed, seed structure & function ”.pptx
“ Importance of seed, seed structure & function ”.pptxAKSHAYMAGAR17

Writing Agony Letter & If type O+1 & Diphthongs + Text “Arab Science”.pdf
Writing Agony Letter & If type O+1 & Diphthongs + Text “Arab Science”.pdfMr Bounab Samir

Intuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsTushar Tank

Health Education - Meaning, Definition, Concept, Factors Influencing Health
Health Education - Meaning, Definition, Concept, Factors Influencing HealthRabiya Husain

Website Fixer-Upper Series to Boost your Online Presence
Website Fixer-Upper Series to Boost your Online PresenceSamantha Russell

UG - Water Disinfection.pptx
UG - Water Disinfection.pptxMelbinRockieMJ1

Sudden Death of Beliefs
Sudden Death of BeliefsRay Poynter

2.15.24 The Birmingham Campaign and MLK.pptx
2.15.24 The Birmingham Campaign and MLK.pptxMaryPotorti1

Blue Persuasive Writing English Essay Worksheet (1).pdf
Blue Persuasive Writing English Essay Worksheet (1).pdfAngelaAmparado

Bayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with ExamplesTushar Tank

Chromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-Principleblessipriyanka

mean stack mean stack mean stack mean stack
mean stack mean stack mean stack mean stackNuttavutThongjor1

General Principles of treatment of Poisoning
General Principles of treatment of Poisoningsak109shi

Metabolism of Galactose & fructose .pptx
Metabolism of Galactose & fructose .pptxDr. Santhosh Kumar. N

Cardiovascular Pathophysiology- Hypertension

CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptxAnupkumar Sharma

Grantseeking Solo- Securing Awards with Limited Staff PDF.pdf
Grantseeking Solo- Securing Awards with Limited Staff PDF.pdfTechSoup

2023 MAP Data Analysis - St. Louis Region
2023 MAP Data Analysis - St. Louis Region

Advance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-B

Use integers to explore high and low places.pptx
Use integers to explore high and low places.pptx

“ Importance of seed, seed structure & function ”.pptx
“ Importance of seed, seed structure & function ”.pptx

Writing Agony Letter & If type O+1 & Diphthongs + Text “Arab Science”.pdf
Writing Agony Letter & If type O+1 & Diphthongs + Text “Arab Science”.pdf

Intuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov Chains

Health Education - Meaning, Definition, Concept, Factors Influencing Health
Health Education - Meaning, Definition, Concept, Factors Influencing Health

Website Fixer-Upper Series to Boost your Online Presence
Website Fixer-Upper Series to Boost your Online Presence

UG - Water Disinfection.pptx
UG - Water Disinfection.pptx

Sudden Death of Beliefs
Sudden Death of Beliefs

2.15.24 The Birmingham Campaign and MLK.pptx
2.15.24 The Birmingham Campaign and MLK.pptx

Blue Persuasive Writing English Essay Worksheet (1).pdf
Blue Persuasive Writing English Essay Worksheet (1).pdf

Bayesian Analysis Fundamentals with Examples
Bayesian Analysis Fundamentals with Examples

Chromatography-Gas chromatography-Principle
Chromatography-Gas chromatography-Principle

mean stack mean stack mean stack mean stack
mean stack mean stack mean stack mean stack

General Principles of treatment of Poisoning
General Principles of treatment of Poisoning

Metabolism of Galactose & fructose .pptx
Metabolism of Galactose & fructose .pptx

Cardiovascular Pathophysiology- Hypertension
Cardiovascular Pathophysiology- Hypertension

CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx
CONCEPTS OF ENVIRONMENT & ECOSYSTEM.pptx

Grantseeking Solo- Securing Awards with Limited Staff PDF.pdf
Grantseeking Solo- Securing Awards with Limited Staff PDF.pdf

### We consider the following problem Suppose that you are give.pdf

• 1. We consider the following problem: Suppose that you are given a 0/1 string S of kind 1m0n, that is, it has m01 's at the beginning, followed by n00 's. Note that m and n are unknown to the algorithm, only k=m+n is known. Also note, that either m or n can be equal to zero, but not both. (a) [14 marks] Design a divide-and-conquer algorithm that finds the number of zeroes in S in time O(logk), where k=m+n. Assume that the input string S is given in an array S[1,,k]. Give a brief argument showing that your algorithm is correct. (b) [12 marks] Give an argument that your algorithm indeed has O(logk) running time, by formulating, explaining and solving an appropriate recurrence equation. Assume that each comparison or arithmetic operation takes constant time.
Current LanguageEnglish
Español
Portugues
Français
Deutsche
© 2024 SlideShare from Scribd