SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
Question #20 from Chapter 3 Section 1:
Describe an algorithim for finding both the largest and the smallest integers in a finite sequence
of integers.
Solution
Let n be the total number of integers. Have k be the "count" of the sequence,
where f(k) gives you the integer at that "space" in the sequence. (i.e. f(3) in a sequence 2,3,6
would be f(3)=6) Let h be your highest value, and l be your lowest value. Start with an
algorithm for finding the largest number: 1. Set h and k equal to zero. (h=k=0) 2. If f(k)>h, then
h=f(k). 3. Add 1 to k. (k+1) 4. Loop the above two steps until k=n. (Loop back to step 2 until
k=n) This will both allow you to keep replacing h with the next highest number, and also end the
loop. Similarly with an algorithm for finding your lowest number: 1. Set h and k equal to zero.
(h=k=0) 2. If f(k)

Más contenido relacionado

Similar a Question #20 from Chapter 3 Section 1Describe an algorithim for f.pdf

In three of the exercises below there is given a code of a method na.pdf
In three of the exercises below there is given a code of a method na.pdfIn three of the exercises below there is given a code of a method na.pdf
In three of the exercises below there is given a code of a method na.pdffeelinggift
 
Exercise roots of equations
Exercise roots of equationsExercise roots of equations
Exercise roots of equationsDUBAN CASTRO
 
Exercise roots of equations
Exercise roots of equationsExercise roots of equations
Exercise roots of equationsDUBAN CASTRO
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theoremWathna
 
Mathematics Ist year pdf.pdf
Mathematics Ist year pdf.pdfMathematics Ist year pdf.pdf
Mathematics Ist year pdf.pdfproacademyhub
 
390 Guided Projects Guided Project 31 Cooling cof.docx
390        Guided Projects Guided Project 31  Cooling cof.docx390        Guided Projects Guided Project 31  Cooling cof.docx
390 Guided Projects Guided Project 31 Cooling cof.docxrhetttrevannion
 
390 Guided Projects Guided Project 31 Cooling cof.docx
390        Guided Projects Guided Project 31  Cooling cof.docx390        Guided Projects Guided Project 31  Cooling cof.docx
390 Guided Projects Guided Project 31 Cooling cof.docxgilbertkpeters11344
 
Data Structure and Algorithms Hashing
Data Structure and Algorithms HashingData Structure and Algorithms Hashing
Data Structure and Algorithms HashingManishPrajapati78
 
Mathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpMathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpExcel Homework Help
 
Study on a class of recursive functions
Study on a class of recursive functionsStudy on a class of recursive functions
Study on a class of recursive functionsLuca Polidori
 
Common fixed point theorems for contractive maps of
Common fixed point theorems for contractive maps ofCommon fixed point theorems for contractive maps of
Common fixed point theorems for contractive maps ofAlexander Decker
 

Similar a Question #20 from Chapter 3 Section 1Describe an algorithim for f.pdf (20)

In three of the exercises below there is given a code of a method na.pdf
In three of the exercises below there is given a code of a method na.pdfIn three of the exercises below there is given a code of a method na.pdf
In three of the exercises below there is given a code of a method na.pdf
 
Exercise roots of equations
Exercise roots of equationsExercise roots of equations
Exercise roots of equations
 
Exercise roots of equations
Exercise roots of equationsExercise roots of equations
Exercise roots of equations
 
Mathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpMathematical Statistics Assignment Help
Mathematical Statistics Assignment Help
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
13-hashing.ppt
13-hashing.ppt13-hashing.ppt
13-hashing.ppt
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theorem
 
Mathematics Ist year pdf.pdf
Mathematics Ist year pdf.pdfMathematics Ist year pdf.pdf
Mathematics Ist year pdf.pdf
 
Maths 11
Maths 11Maths 11
Maths 11
 
390 Guided Projects Guided Project 31 Cooling cof.docx
390        Guided Projects Guided Project 31  Cooling cof.docx390        Guided Projects Guided Project 31  Cooling cof.docx
390 Guided Projects Guided Project 31 Cooling cof.docx
 
390 Guided Projects Guided Project 31 Cooling cof.docx
390        Guided Projects Guided Project 31  Cooling cof.docx390        Guided Projects Guided Project 31  Cooling cof.docx
390 Guided Projects Guided Project 31 Cooling cof.docx
 
Maths project
Maths projectMaths project
Maths project
 
An introduction to probability theory geiss
An introduction to probability theory   geissAn introduction to probability theory   geiss
An introduction to probability theory geiss
 
Data Structure and Algorithms Hashing
Data Structure and Algorithms HashingData Structure and Algorithms Hashing
Data Structure and Algorithms Hashing
 
Mathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpMathematical Statistics Assignment Help
Mathematical Statistics Assignment Help
 
02 Notes Divide and Conquer
02 Notes Divide and Conquer02 Notes Divide and Conquer
02 Notes Divide and Conquer
 
Study on a class of recursive functions
Study on a class of recursive functionsStudy on a class of recursive functions
Study on a class of recursive functions
 
Unit 3
Unit 3Unit 3
Unit 3
 
Unit 3
Unit 3Unit 3
Unit 3
 
Common fixed point theorems for contractive maps of
Common fixed point theorems for contractive maps ofCommon fixed point theorems for contractive maps of
Common fixed point theorems for contractive maps of
 

Más de airwaysknits

Question 1 (15 marks)The allocation of promotional dollars between.pdf
Question 1 (15 marks)The allocation of promotional dollars between.pdfQuestion 1 (15 marks)The allocation of promotional dollars between.pdf
Question 1 (15 marks)The allocation of promotional dollars between.pdfairwaysknits
 
Question #3 Distinguish between operating mergers and financial mer.pdf
Question #3 Distinguish between operating mergers and financial mer.pdfQuestion #3 Distinguish between operating mergers and financial mer.pdf
Question #3 Distinguish between operating mergers and financial mer.pdfairwaysknits
 
Question 172.5 points Save  Which of the following is the first step.pdf
Question  172.5 points  Save  Which of the following is the first step.pdfQuestion  172.5 points  Save  Which of the following is the first step.pdf
Question 172.5 points Save  Which of the following is the first step.pdfairwaysknits
 
Question 12.5 points Save  The culture-specific approach gives emplo.pdf
Question  12.5 points  Save  The culture-specific approach gives emplo.pdfQuestion  12.5 points  Save  The culture-specific approach gives emplo.pdf
Question 12.5 points Save  The culture-specific approach gives emplo.pdfairwaysknits
 
Question 12.5 points Save  Coordination involves encouraging the com.pdf
Question  12.5 points  Save  Coordination involves encouraging the com.pdfQuestion  12.5 points  Save  Coordination involves encouraging the com.pdf
Question 12.5 points Save  Coordination involves encouraging the com.pdfairwaysknits
 
Quantitative easing is a policy employed by the US in recent times. .pdf
Quantitative easing is a policy employed by the US in recent times. .pdfQuantitative easing is a policy employed by the US in recent times. .pdf
Quantitative easing is a policy employed by the US in recent times. .pdfairwaysknits
 
Qualitative vs. Quantitative describe recent study and whether the d.pdf
Qualitative vs. Quantitative describe recent study and whether the d.pdfQualitative vs. Quantitative describe recent study and whether the d.pdf
Qualitative vs. Quantitative describe recent study and whether the d.pdfairwaysknits
 
Q6)In deep soil mixing of Portland cement with clay, three reactio.pdf
Q6)In deep soil mixing of Portland cement with clay, three reactio.pdfQ6)In deep soil mixing of Portland cement with clay, three reactio.pdf
Q6)In deep soil mixing of Portland cement with clay, three reactio.pdfairwaysknits
 
Q21. A nations raw materials and sources of energy are considered .pdf
Q21. A nations raw materials and sources of energy are considered .pdfQ21. A nations raw materials and sources of energy are considered .pdf
Q21. A nations raw materials and sources of energy are considered .pdfairwaysknits
 
Q11.one of the great discoveries of biology is that organisms have a.pdf
Q11.one of the great discoveries of biology is that organisms have a.pdfQ11.one of the great discoveries of biology is that organisms have a.pdf
Q11.one of the great discoveries of biology is that organisms have a.pdfairwaysknits
 
Q1. Which of the following examples best aligns a companys compete.pdf
Q1. Which of the following examples best aligns a companys compete.pdfQ1. Which of the following examples best aligns a companys compete.pdf
Q1. Which of the following examples best aligns a companys compete.pdfairwaysknits
 
Q1. The total resource cost of goods and services produced by the U..pdf
Q1. The total resource cost of goods and services produced by the U..pdfQ1. The total resource cost of goods and services produced by the U..pdf
Q1. The total resource cost of goods and services produced by the U..pdfairwaysknits
 
Q1. Definitions of leadership     a. strongly influence the desig.pdf
Q1. Definitions of leadership     a. strongly influence the desig.pdfQ1. Definitions of leadership     a. strongly influence the desig.pdf
Q1. Definitions of leadership     a. strongly influence the desig.pdfairwaysknits
 
Q1 Writing is an important form of communication. Goodwriters use d.pdf
Q1 Writing is an important form of communication. Goodwriters use d.pdfQ1 Writing is an important form of communication. Goodwriters use d.pdf
Q1 Writing is an important form of communication. Goodwriters use d.pdfairwaysknits
 
Q1 Signal words help to lead the reader in thedirection writer want.pdf
Q1 Signal words help to lead the reader in thedirection writer want.pdfQ1 Signal words help to lead the reader in thedirection writer want.pdf
Q1 Signal words help to lead the reader in thedirection writer want.pdfairwaysknits
 
Q. The House managed to load the die in such a way that the faces “2.pdf
Q. The House managed to load the die in such a way that the faces “2.pdfQ. The House managed to load the die in such a way that the faces “2.pdf
Q. The House managed to load the die in such a way that the faces “2.pdfairwaysknits
 
Q. The House managed to load the die in such a way that the faces .pdf
Q. The House managed to load the die in such a way that the faces .pdfQ. The House managed to load the die in such a way that the faces .pdf
Q. The House managed to load the die in such a way that the faces .pdfairwaysknits
 
Q.1 What is the purpose of audit risk assessment What are its objec.pdf
Q.1 What is the purpose of audit risk assessment What are its objec.pdfQ.1 What is the purpose of audit risk assessment What are its objec.pdf
Q.1 What is the purpose of audit risk assessment What are its objec.pdfairwaysknits
 
Q.Compute the point estimate of the proportion of Republicans wh.pdf
Q.Compute the point estimate of the proportion of Republicans wh.pdfQ.Compute the point estimate of the proportion of Republicans wh.pdf
Q.Compute the point estimate of the proportion of Republicans wh.pdfairwaysknits
 

Más de airwaysknits (19)

Question 1 (15 marks)The allocation of promotional dollars between.pdf
Question 1 (15 marks)The allocation of promotional dollars between.pdfQuestion 1 (15 marks)The allocation of promotional dollars between.pdf
Question 1 (15 marks)The allocation of promotional dollars between.pdf
 
Question #3 Distinguish between operating mergers and financial mer.pdf
Question #3 Distinguish between operating mergers and financial mer.pdfQuestion #3 Distinguish between operating mergers and financial mer.pdf
Question #3 Distinguish between operating mergers and financial mer.pdf
 
Question 172.5 points Save  Which of the following is the first step.pdf
Question  172.5 points  Save  Which of the following is the first step.pdfQuestion  172.5 points  Save  Which of the following is the first step.pdf
Question 172.5 points Save  Which of the following is the first step.pdf
 
Question 12.5 points Save  The culture-specific approach gives emplo.pdf
Question  12.5 points  Save  The culture-specific approach gives emplo.pdfQuestion  12.5 points  Save  The culture-specific approach gives emplo.pdf
Question 12.5 points Save  The culture-specific approach gives emplo.pdf
 
Question 12.5 points Save  Coordination involves encouraging the com.pdf
Question  12.5 points  Save  Coordination involves encouraging the com.pdfQuestion  12.5 points  Save  Coordination involves encouraging the com.pdf
Question 12.5 points Save  Coordination involves encouraging the com.pdf
 
Quantitative easing is a policy employed by the US in recent times. .pdf
Quantitative easing is a policy employed by the US in recent times. .pdfQuantitative easing is a policy employed by the US in recent times. .pdf
Quantitative easing is a policy employed by the US in recent times. .pdf
 
Qualitative vs. Quantitative describe recent study and whether the d.pdf
Qualitative vs. Quantitative describe recent study and whether the d.pdfQualitative vs. Quantitative describe recent study and whether the d.pdf
Qualitative vs. Quantitative describe recent study and whether the d.pdf
 
Q6)In deep soil mixing of Portland cement with clay, three reactio.pdf
Q6)In deep soil mixing of Portland cement with clay, three reactio.pdfQ6)In deep soil mixing of Portland cement with clay, three reactio.pdf
Q6)In deep soil mixing of Portland cement with clay, three reactio.pdf
 
Q21. A nations raw materials and sources of energy are considered .pdf
Q21. A nations raw materials and sources of energy are considered .pdfQ21. A nations raw materials and sources of energy are considered .pdf
Q21. A nations raw materials and sources of energy are considered .pdf
 
Q11.one of the great discoveries of biology is that organisms have a.pdf
Q11.one of the great discoveries of biology is that organisms have a.pdfQ11.one of the great discoveries of biology is that organisms have a.pdf
Q11.one of the great discoveries of biology is that organisms have a.pdf
 
Q1. Which of the following examples best aligns a companys compete.pdf
Q1. Which of the following examples best aligns a companys compete.pdfQ1. Which of the following examples best aligns a companys compete.pdf
Q1. Which of the following examples best aligns a companys compete.pdf
 
Q1. The total resource cost of goods and services produced by the U..pdf
Q1. The total resource cost of goods and services produced by the U..pdfQ1. The total resource cost of goods and services produced by the U..pdf
Q1. The total resource cost of goods and services produced by the U..pdf
 
Q1. Definitions of leadership     a. strongly influence the desig.pdf
Q1. Definitions of leadership     a. strongly influence the desig.pdfQ1. Definitions of leadership     a. strongly influence the desig.pdf
Q1. Definitions of leadership     a. strongly influence the desig.pdf
 
Q1 Writing is an important form of communication. Goodwriters use d.pdf
Q1 Writing is an important form of communication. Goodwriters use d.pdfQ1 Writing is an important form of communication. Goodwriters use d.pdf
Q1 Writing is an important form of communication. Goodwriters use d.pdf
 
Q1 Signal words help to lead the reader in thedirection writer want.pdf
Q1 Signal words help to lead the reader in thedirection writer want.pdfQ1 Signal words help to lead the reader in thedirection writer want.pdf
Q1 Signal words help to lead the reader in thedirection writer want.pdf
 
Q. The House managed to load the die in such a way that the faces “2.pdf
Q. The House managed to load the die in such a way that the faces “2.pdfQ. The House managed to load the die in such a way that the faces “2.pdf
Q. The House managed to load the die in such a way that the faces “2.pdf
 
Q. The House managed to load the die in such a way that the faces .pdf
Q. The House managed to load the die in such a way that the faces .pdfQ. The House managed to load the die in such a way that the faces .pdf
Q. The House managed to load the die in such a way that the faces .pdf
 
Q.1 What is the purpose of audit risk assessment What are its objec.pdf
Q.1 What is the purpose of audit risk assessment What are its objec.pdfQ.1 What is the purpose of audit risk assessment What are its objec.pdf
Q.1 What is the purpose of audit risk assessment What are its objec.pdf
 
Q.Compute the point estimate of the proportion of Republicans wh.pdf
Q.Compute the point estimate of the proportion of Republicans wh.pdfQ.Compute the point estimate of the proportion of Republicans wh.pdf
Q.Compute the point estimate of the proportion of Republicans wh.pdf
 

Último

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
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
 
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
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
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
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
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
 

Último (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
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
 
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...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
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
 
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
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
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
 

Question #20 from Chapter 3 Section 1Describe an algorithim for f.pdf

  • 1. Question #20 from Chapter 3 Section 1: Describe an algorithim for finding both the largest and the smallest integers in a finite sequence of integers. Solution Let n be the total number of integers. Have k be the "count" of the sequence, where f(k) gives you the integer at that "space" in the sequence. (i.e. f(3) in a sequence 2,3,6 would be f(3)=6) Let h be your highest value, and l be your lowest value. Start with an algorithm for finding the largest number: 1. Set h and k equal to zero. (h=k=0) 2. If f(k)>h, then h=f(k). 3. Add 1 to k. (k+1) 4. Loop the above two steps until k=n. (Loop back to step 2 until k=n) This will both allow you to keep replacing h with the next highest number, and also end the loop. Similarly with an algorithm for finding your lowest number: 1. Set h and k equal to zero. (h=k=0) 2. If f(k)