SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
This question is about search. (a) Explain how an algorithm, EQUALS( a,b b might check if two
words, a and b, are identical. For example, if x= "computer" and y= "algorithm" and z= "computer"
then EQUALS (x,y) would return false, but EQUALS (x,z) would return true. (You can assume that
a word is represented as a sequence of characters.) [5 marks] (b) Suppose each word in a long
book is stored in an array. For example, an array holding each word of the book 'Introduction to
Algorithms' by Cormen et al would begin <n, "Before", "there", "were", "computers", "there",
"were", "algorithms", ...> where n is the number of words in the book. Devise an algorithm to check
if a particular word, for example "crazy", or "greedy", occurs in the book. Your algorithm can freely
use EQUALS(a, b) without having to provide an implementation. Draw a flowchart representation
of your algorithm. [5 marks] (c) Express your algorithm in part (a) as pseudocode. [5 marks]

Mais conteúdo relacionado

Mais de adinathfashion1

This is NOT TRUE concerning courtship sounds Question 2 opt.pdf
This is NOT TRUE concerning courtship sounds Question 2 opt.pdfThis is NOT TRUE concerning courtship sounds Question 2 opt.pdf
This is NOT TRUE concerning courtship sounds Question 2 opt.pdfadinathfashion1
 
This is what I got for 54 but Im unsure if its right Prepa.pdf
This is what I got for 54 but Im unsure if its right Prepa.pdfThis is what I got for 54 but Im unsure if its right Prepa.pdf
This is what I got for 54 but Im unsure if its right Prepa.pdfadinathfashion1
 
This PNF technique starts with the same process as the the h.pdf
This PNF technique starts with the same process as the the h.pdfThis PNF technique starts with the same process as the the h.pdf
This PNF technique starts with the same process as the the h.pdfadinathfashion1
 
This is where you set up the project infrastructure to help .pdf
This is where you set up the project infrastructure to help .pdfThis is where you set up the project infrastructure to help .pdf
This is where you set up the project infrastructure to help .pdfadinathfashion1
 
This is a true case study A woman kept coming to the doctor.pdf
This is a true case study A woman kept coming to the doctor.pdfThis is a true case study A woman kept coming to the doctor.pdf
This is a true case study A woman kept coming to the doctor.pdfadinathfashion1
 
To answer Questions 14 and 15 read the article Britain.pdf
To answer Questions 14 and 15 read the article Britain.pdfTo answer Questions 14 and 15 read the article Britain.pdf
To answer Questions 14 and 15 read the article Britain.pdfadinathfashion1
 
To adhere to Endangered Species Act ESA guidelines the Fi.pdf
To adhere to Endangered Species Act ESA guidelines the Fi.pdfTo adhere to Endangered Species Act ESA guidelines the Fi.pdf
To adhere to Endangered Species Act ESA guidelines the Fi.pdfadinathfashion1
 
Title Media culture Objectives 1 To apply aseptic techniq.pdf
Title Media culture Objectives 1 To apply aseptic techniq.pdfTitle Media culture Objectives 1 To apply aseptic techniq.pdf
Title Media culture Objectives 1 To apply aseptic techniq.pdfadinathfashion1
 
TitleInvestigating the effect of counterfeit permits on the.pdf
TitleInvestigating the effect of counterfeit permits on the.pdfTitleInvestigating the effect of counterfeit permits on the.pdf
TitleInvestigating the effect of counterfeit permits on the.pdfadinathfashion1
 
Tketici talebindeki kk deiiklikler aadaki nedenlerle ve.pdf
Tketici talebindeki kk deiiklikler aadaki nedenlerle ve.pdfTketici talebindeki kk deiiklikler aadaki nedenlerle ve.pdf
Tketici talebindeki kk deiiklikler aadaki nedenlerle ve.pdfadinathfashion1
 
Titanic Project Management Blunders Links to an external s.pdf
Titanic  Project Management Blunders Links to an external s.pdfTitanic  Project Management Blunders Links to an external s.pdf
Titanic Project Management Blunders Links to an external s.pdfadinathfashion1
 
This is my table met Mry anlea Nole isch studein las diru ev.pdf
This is my table met Mry anlea Nole isch studein las diru ev.pdfThis is my table met Mry anlea Nole isch studein las diru ev.pdf
This is my table met Mry anlea Nole isch studein las diru ev.pdfadinathfashion1
 
TITLE MAKE A PROJECT ON THE WORKING OF PARLIAMENTARY FORM O.pdf
TITLE MAKE A PROJECT ON THE WORKING OF PARLIAMENTARY FORM O.pdfTITLE MAKE A PROJECT ON THE WORKING OF PARLIAMENTARY FORM O.pdf
TITLE MAKE A PROJECT ON THE WORKING OF PARLIAMENTARY FORM O.pdfadinathfashion1
 
Tipik bir yklenim dzenlemesinde yatrm bankacl firmas I H.pdf
Tipik bir yklenim dzenlemesinde yatrm bankacl firmas I H.pdfTipik bir yklenim dzenlemesinde yatrm bankacl firmas I H.pdf
Tipik bir yklenim dzenlemesinde yatrm bankacl firmas I H.pdfadinathfashion1
 
Tiyatro iin Orta ada din tiyatroyu nasl etkiledi .pdf
Tiyatro iin    Orta ada din tiyatroyu nasl etkiledi    .pdfTiyatro iin    Orta ada din tiyatroyu nasl etkiledi    .pdf
Tiyatro iin Orta ada din tiyatroyu nasl etkiledi .pdfadinathfashion1
 
tissues were taken from two populations to investigate.pdf
tissues were taken from two populations to investigate.pdftissues were taken from two populations to investigate.pdf
tissues were taken from two populations to investigate.pdfadinathfashion1
 
Tirar dinero bueno despus de malo la iniciativa de medios.pdf
Tirar dinero bueno despus de malo la iniciativa de medios.pdfTirar dinero bueno despus de malo la iniciativa de medios.pdf
Tirar dinero bueno despus de malo la iniciativa de medios.pdfadinathfashion1
 
Tisdale Incorporated reports the following amounts in its De.pdf
Tisdale Incorporated reports the following amounts in its De.pdfTisdale Incorporated reports the following amounts in its De.pdf
Tisdale Incorporated reports the following amounts in its De.pdfadinathfashion1
 
Time left 04519 Question 3 Not yet answered Marked out of .pdf
Time left 04519 Question 3 Not yet answered Marked out of .pdfTime left 04519 Question 3 Not yet answered Marked out of .pdf
Time left 04519 Question 3 Not yet answered Marked out of .pdfadinathfashion1
 
tion Techs current network consists of 1 web server access.pdf
tion Techs current network consists of 1 web server access.pdftion Techs current network consists of 1 web server access.pdf
tion Techs current network consists of 1 web server access.pdfadinathfashion1
 

Mais de adinathfashion1 (20)

This is NOT TRUE concerning courtship sounds Question 2 opt.pdf
This is NOT TRUE concerning courtship sounds Question 2 opt.pdfThis is NOT TRUE concerning courtship sounds Question 2 opt.pdf
This is NOT TRUE concerning courtship sounds Question 2 opt.pdf
 
This is what I got for 54 but Im unsure if its right Prepa.pdf
This is what I got for 54 but Im unsure if its right Prepa.pdfThis is what I got for 54 but Im unsure if its right Prepa.pdf
This is what I got for 54 but Im unsure if its right Prepa.pdf
 
This PNF technique starts with the same process as the the h.pdf
This PNF technique starts with the same process as the the h.pdfThis PNF technique starts with the same process as the the h.pdf
This PNF technique starts with the same process as the the h.pdf
 
This is where you set up the project infrastructure to help .pdf
This is where you set up the project infrastructure to help .pdfThis is where you set up the project infrastructure to help .pdf
This is where you set up the project infrastructure to help .pdf
 
This is a true case study A woman kept coming to the doctor.pdf
This is a true case study A woman kept coming to the doctor.pdfThis is a true case study A woman kept coming to the doctor.pdf
This is a true case study A woman kept coming to the doctor.pdf
 
To answer Questions 14 and 15 read the article Britain.pdf
To answer Questions 14 and 15 read the article Britain.pdfTo answer Questions 14 and 15 read the article Britain.pdf
To answer Questions 14 and 15 read the article Britain.pdf
 
To adhere to Endangered Species Act ESA guidelines the Fi.pdf
To adhere to Endangered Species Act ESA guidelines the Fi.pdfTo adhere to Endangered Species Act ESA guidelines the Fi.pdf
To adhere to Endangered Species Act ESA guidelines the Fi.pdf
 
Title Media culture Objectives 1 To apply aseptic techniq.pdf
Title Media culture Objectives 1 To apply aseptic techniq.pdfTitle Media culture Objectives 1 To apply aseptic techniq.pdf
Title Media culture Objectives 1 To apply aseptic techniq.pdf
 
TitleInvestigating the effect of counterfeit permits on the.pdf
TitleInvestigating the effect of counterfeit permits on the.pdfTitleInvestigating the effect of counterfeit permits on the.pdf
TitleInvestigating the effect of counterfeit permits on the.pdf
 
Tketici talebindeki kk deiiklikler aadaki nedenlerle ve.pdf
Tketici talebindeki kk deiiklikler aadaki nedenlerle ve.pdfTketici talebindeki kk deiiklikler aadaki nedenlerle ve.pdf
Tketici talebindeki kk deiiklikler aadaki nedenlerle ve.pdf
 
Titanic Project Management Blunders Links to an external s.pdf
Titanic  Project Management Blunders Links to an external s.pdfTitanic  Project Management Blunders Links to an external s.pdf
Titanic Project Management Blunders Links to an external s.pdf
 
This is my table met Mry anlea Nole isch studein las diru ev.pdf
This is my table met Mry anlea Nole isch studein las diru ev.pdfThis is my table met Mry anlea Nole isch studein las diru ev.pdf
This is my table met Mry anlea Nole isch studein las diru ev.pdf
 
TITLE MAKE A PROJECT ON THE WORKING OF PARLIAMENTARY FORM O.pdf
TITLE MAKE A PROJECT ON THE WORKING OF PARLIAMENTARY FORM O.pdfTITLE MAKE A PROJECT ON THE WORKING OF PARLIAMENTARY FORM O.pdf
TITLE MAKE A PROJECT ON THE WORKING OF PARLIAMENTARY FORM O.pdf
 
Tipik bir yklenim dzenlemesinde yatrm bankacl firmas I H.pdf
Tipik bir yklenim dzenlemesinde yatrm bankacl firmas I H.pdfTipik bir yklenim dzenlemesinde yatrm bankacl firmas I H.pdf
Tipik bir yklenim dzenlemesinde yatrm bankacl firmas I H.pdf
 
Tiyatro iin Orta ada din tiyatroyu nasl etkiledi .pdf
Tiyatro iin    Orta ada din tiyatroyu nasl etkiledi    .pdfTiyatro iin    Orta ada din tiyatroyu nasl etkiledi    .pdf
Tiyatro iin Orta ada din tiyatroyu nasl etkiledi .pdf
 
tissues were taken from two populations to investigate.pdf
tissues were taken from two populations to investigate.pdftissues were taken from two populations to investigate.pdf
tissues were taken from two populations to investigate.pdf
 
Tirar dinero bueno despus de malo la iniciativa de medios.pdf
Tirar dinero bueno despus de malo la iniciativa de medios.pdfTirar dinero bueno despus de malo la iniciativa de medios.pdf
Tirar dinero bueno despus de malo la iniciativa de medios.pdf
 
Tisdale Incorporated reports the following amounts in its De.pdf
Tisdale Incorporated reports the following amounts in its De.pdfTisdale Incorporated reports the following amounts in its De.pdf
Tisdale Incorporated reports the following amounts in its De.pdf
 
Time left 04519 Question 3 Not yet answered Marked out of .pdf
Time left 04519 Question 3 Not yet answered Marked out of .pdfTime left 04519 Question 3 Not yet answered Marked out of .pdf
Time left 04519 Question 3 Not yet answered Marked out of .pdf
 
tion Techs current network consists of 1 web server access.pdf
tion Techs current network consists of 1 web server access.pdftion Techs current network consists of 1 web server access.pdf
tion Techs current network consists of 1 web server access.pdf
 

Último

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
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
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
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
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 

Último (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
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
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
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
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

This question is about search a Explain how an algorithm.pdf

  • 1. This question is about search. (a) Explain how an algorithm, EQUALS( a,b b might check if two words, a and b, are identical. For example, if x= "computer" and y= "algorithm" and z= "computer" then EQUALS (x,y) would return false, but EQUALS (x,z) would return true. (You can assume that a word is represented as a sequence of characters.) [5 marks] (b) Suppose each word in a long book is stored in an array. For example, an array holding each word of the book 'Introduction to Algorithms' by Cormen et al would begin <n, "Before", "there", "were", "computers", "there", "were", "algorithms", ...> where n is the number of words in the book. Devise an algorithm to check if a particular word, for example "crazy", or "greedy", occurs in the book. Your algorithm can freely use EQUALS(a, b) without having to provide an implementation. Draw a flowchart representation of your algorithm. [5 marks] (c) Express your algorithm in part (a) as pseudocode. [5 marks]