SlideShare a Scribd company logo
Please write in python. Thank you!
Problem 6 Write down the running time equation, T ( n ) , of the program do_something below.
Note that list's pop takes constant ( ( 1 )) time. def do_something ( L ) : if len ( L ) < 2 : return 1
total = 0 for x in L : total + = x first = L pop ( 0 ) last = L . pop ( 1 ) if first==last: return total +
do_something ( L ) else: return 2 total + do_something ( L )

More Related Content

More from EdwardEkRChapmann

Provide an appropriate response- A university must choose a team of 6.docx
Provide an appropriate response- A university must choose a team of 6.docxProvide an appropriate response- A university must choose a team of 6.docx
Provide an appropriate response- A university must choose a team of 6.docx
EdwardEkRChapmann
 
Prove x is even (x+1)2 is odd (hint- use a direct proof).docx
Prove x is even (x+1)2 is odd (hint- use a direct proof).docxProve x is even (x+1)2 is odd (hint- use a direct proof).docx
Prove x is even (x+1)2 is odd (hint- use a direct proof).docx
EdwardEkRChapmann
 
Protein utilization by bacteria leads to generation of end products th.docx
Protein utilization by bacteria leads to generation of end products th.docxProtein utilization by bacteria leads to generation of end products th.docx
Protein utilization by bacteria leads to generation of end products th.docx
EdwardEkRChapmann
 
Project Scope Statement for the MXE Project Introduction - The purpo.docx
Project Scope Statement for the MXE Project   Introduction - The purpo.docxProject Scope Statement for the MXE Project   Introduction - The purpo.docx
Project Scope Statement for the MXE Project Introduction - The purpo.docx
EdwardEkRChapmann
 
Project Closing Document The purpose of this document is to capture.docx
Project Closing Document   The purpose of this document is to capture.docxProject Closing Document   The purpose of this document is to capture.docx
Project Closing Document The purpose of this document is to capture.docx
EdwardEkRChapmann
 
Problem II - Control of gastric acidity- 1- What is the trigger to tar.docx
Problem II - Control of gastric acidity- 1- What is the trigger to tar.docxProblem II - Control of gastric acidity- 1- What is the trigger to tar.docx
Problem II - Control of gastric acidity- 1- What is the trigger to tar.docx
EdwardEkRChapmann
 
Problem B (5 points)- The health board of a major city wants to know i.docx
Problem B (5 points)- The health board of a major city wants to know i.docxProblem B (5 points)- The health board of a major city wants to know i.docx
Problem B (5 points)- The health board of a major city wants to know i.docx
EdwardEkRChapmann
 
Problem B part a Suppose A-B are events with indicators IA-IB- What va.docx
Problem B part a Suppose A-B are events with indicators IA-IB- What va.docxProblem B part a Suppose A-B are events with indicators IA-IB- What va.docx
Problem B part a Suppose A-B are events with indicators IA-IB- What va.docx
EdwardEkRChapmann
 
Problem 8 and 9 Entropy is closely related to something known as Kolmo.docx
Problem 8 and 9 Entropy is closely related to something known as Kolmo.docxProblem 8 and 9 Entropy is closely related to something known as Kolmo.docx
Problem 8 and 9 Entropy is closely related to something known as Kolmo.docx
EdwardEkRChapmann
 
Problem 4-45 (LO- 4) Nell and Kirby are in the process of negotiating.docx
Problem 4-45 (LO- 4) Nell and Kirby are in the process of negotiating.docxProblem 4-45 (LO- 4) Nell and Kirby are in the process of negotiating.docx
Problem 4-45 (LO- 4) Nell and Kirby are in the process of negotiating.docx
EdwardEkRChapmann
 
Problem 3- Reynolds number (Problem 7 of the textbook) (4 points) A sa.docx
Problem 3- Reynolds number (Problem 7 of the textbook) (4 points) A sa.docxProblem 3- Reynolds number (Problem 7 of the textbook) (4 points) A sa.docx
Problem 3- Reynolds number (Problem 7 of the textbook) (4 points) A sa.docx
EdwardEkRChapmann
 
Problem 2 (20 points- graded on accuracy) Consider a circle of radius.docx
Problem 2 (20 points- graded on accuracy) Consider a circle of radius.docxProblem 2 (20 points- graded on accuracy) Consider a circle of radius.docx
Problem 2 (20 points- graded on accuracy) Consider a circle of radius.docx
EdwardEkRChapmann
 
Present 3 advantages and 3 disadvantages of each strategy option- Focu.docx
Present 3 advantages and 3 disadvantages of each strategy option- Focu.docxPresent 3 advantages and 3 disadvantages of each strategy option- Focu.docx
Present 3 advantages and 3 disadvantages of each strategy option- Focu.docx
EdwardEkRChapmann
 
Problem 1- (20pt) Four components are connected to form a system as sh.docx
Problem 1- (20pt) Four components are connected to form a system as sh.docxProblem 1- (20pt) Four components are connected to form a system as sh.docx
Problem 1- (20pt) Four components are connected to form a system as sh.docx
EdwardEkRChapmann
 
Probability Distribution -2 What is the Mean of this Probability Di.docx
Probability Distribution    -2 What is the Mean of this Probability Di.docxProbability Distribution    -2 What is the Mean of this Probability Di.docx
Probability Distribution -2 What is the Mean of this Probability Di.docx
EdwardEkRChapmann
 
Prioritize in order- Prioritize in order- Malnutrition- Suicidal Behav.docx
Prioritize in order- Prioritize in order- Malnutrition- Suicidal Behav.docxPrioritize in order- Prioritize in order- Malnutrition- Suicidal Behav.docx
Prioritize in order- Prioritize in order- Malnutrition- Suicidal Behav.docx
EdwardEkRChapmann
 
Principles of Ecology Unit 8- Assignment 2 Critical Thinking- Conserva.docx
Principles of Ecology Unit 8- Assignment 2 Critical Thinking- Conserva.docxPrinciples of Ecology Unit 8- Assignment 2 Critical Thinking- Conserva.docx
Principles of Ecology Unit 8- Assignment 2 Critical Thinking- Conserva.docx
EdwardEkRChapmann
 
Principles of Ecology Unit 6- Assignment 1 Homework chapters 17 and 18.docx
Principles of Ecology Unit 6- Assignment 1 Homework chapters 17 and 18.docxPrinciples of Ecology Unit 6- Assignment 1 Homework chapters 17 and 18.docx
Principles of Ecology Unit 6- Assignment 1 Homework chapters 17 and 18.docx
EdwardEkRChapmann
 
Principles of Ecology Unit 8- Assignment 1 chapters 21-2-21-5 and 22.docx
Principles of Ecology Unit 8- Assignment 1 chapters 21-2-21-5 and 22.docxPrinciples of Ecology Unit 8- Assignment 1 chapters 21-2-21-5 and 22.docx
Principles of Ecology Unit 8- Assignment 1 chapters 21-2-21-5 and 22.docx
EdwardEkRChapmann
 
Principles of Ecology Unit 7- Assignment 1 chapters 19 and 21-1 Cha.docx
Principles of Ecology Unit 7- Assignment 1  chapters 19 and 21-1   Cha.docxPrinciples of Ecology Unit 7- Assignment 1  chapters 19 and 21-1   Cha.docx
Principles of Ecology Unit 7- Assignment 1 chapters 19 and 21-1 Cha.docx
EdwardEkRChapmann
 

More from EdwardEkRChapmann (20)

Provide an appropriate response- A university must choose a team of 6.docx
Provide an appropriate response- A university must choose a team of 6.docxProvide an appropriate response- A university must choose a team of 6.docx
Provide an appropriate response- A university must choose a team of 6.docx
 
Prove x is even (x+1)2 is odd (hint- use a direct proof).docx
Prove x is even (x+1)2 is odd (hint- use a direct proof).docxProve x is even (x+1)2 is odd (hint- use a direct proof).docx
Prove x is even (x+1)2 is odd (hint- use a direct proof).docx
 
Protein utilization by bacteria leads to generation of end products th.docx
Protein utilization by bacteria leads to generation of end products th.docxProtein utilization by bacteria leads to generation of end products th.docx
Protein utilization by bacteria leads to generation of end products th.docx
 
Project Scope Statement for the MXE Project Introduction - The purpo.docx
Project Scope Statement for the MXE Project   Introduction - The purpo.docxProject Scope Statement for the MXE Project   Introduction - The purpo.docx
Project Scope Statement for the MXE Project Introduction - The purpo.docx
 
Project Closing Document The purpose of this document is to capture.docx
Project Closing Document   The purpose of this document is to capture.docxProject Closing Document   The purpose of this document is to capture.docx
Project Closing Document The purpose of this document is to capture.docx
 
Problem II - Control of gastric acidity- 1- What is the trigger to tar.docx
Problem II - Control of gastric acidity- 1- What is the trigger to tar.docxProblem II - Control of gastric acidity- 1- What is the trigger to tar.docx
Problem II - Control of gastric acidity- 1- What is the trigger to tar.docx
 
Problem B (5 points)- The health board of a major city wants to know i.docx
Problem B (5 points)- The health board of a major city wants to know i.docxProblem B (5 points)- The health board of a major city wants to know i.docx
Problem B (5 points)- The health board of a major city wants to know i.docx
 
Problem B part a Suppose A-B are events with indicators IA-IB- What va.docx
Problem B part a Suppose A-B are events with indicators IA-IB- What va.docxProblem B part a Suppose A-B are events with indicators IA-IB- What va.docx
Problem B part a Suppose A-B are events with indicators IA-IB- What va.docx
 
Problem 8 and 9 Entropy is closely related to something known as Kolmo.docx
Problem 8 and 9 Entropy is closely related to something known as Kolmo.docxProblem 8 and 9 Entropy is closely related to something known as Kolmo.docx
Problem 8 and 9 Entropy is closely related to something known as Kolmo.docx
 
Problem 4-45 (LO- 4) Nell and Kirby are in the process of negotiating.docx
Problem 4-45 (LO- 4) Nell and Kirby are in the process of negotiating.docxProblem 4-45 (LO- 4) Nell and Kirby are in the process of negotiating.docx
Problem 4-45 (LO- 4) Nell and Kirby are in the process of negotiating.docx
 
Problem 3- Reynolds number (Problem 7 of the textbook) (4 points) A sa.docx
Problem 3- Reynolds number (Problem 7 of the textbook) (4 points) A sa.docxProblem 3- Reynolds number (Problem 7 of the textbook) (4 points) A sa.docx
Problem 3- Reynolds number (Problem 7 of the textbook) (4 points) A sa.docx
 
Problem 2 (20 points- graded on accuracy) Consider a circle of radius.docx
Problem 2 (20 points- graded on accuracy) Consider a circle of radius.docxProblem 2 (20 points- graded on accuracy) Consider a circle of radius.docx
Problem 2 (20 points- graded on accuracy) Consider a circle of radius.docx
 
Present 3 advantages and 3 disadvantages of each strategy option- Focu.docx
Present 3 advantages and 3 disadvantages of each strategy option- Focu.docxPresent 3 advantages and 3 disadvantages of each strategy option- Focu.docx
Present 3 advantages and 3 disadvantages of each strategy option- Focu.docx
 
Problem 1- (20pt) Four components are connected to form a system as sh.docx
Problem 1- (20pt) Four components are connected to form a system as sh.docxProblem 1- (20pt) Four components are connected to form a system as sh.docx
Problem 1- (20pt) Four components are connected to form a system as sh.docx
 
Probability Distribution -2 What is the Mean of this Probability Di.docx
Probability Distribution    -2 What is the Mean of this Probability Di.docxProbability Distribution    -2 What is the Mean of this Probability Di.docx
Probability Distribution -2 What is the Mean of this Probability Di.docx
 
Prioritize in order- Prioritize in order- Malnutrition- Suicidal Behav.docx
Prioritize in order- Prioritize in order- Malnutrition- Suicidal Behav.docxPrioritize in order- Prioritize in order- Malnutrition- Suicidal Behav.docx
Prioritize in order- Prioritize in order- Malnutrition- Suicidal Behav.docx
 
Principles of Ecology Unit 8- Assignment 2 Critical Thinking- Conserva.docx
Principles of Ecology Unit 8- Assignment 2 Critical Thinking- Conserva.docxPrinciples of Ecology Unit 8- Assignment 2 Critical Thinking- Conserva.docx
Principles of Ecology Unit 8- Assignment 2 Critical Thinking- Conserva.docx
 
Principles of Ecology Unit 6- Assignment 1 Homework chapters 17 and 18.docx
Principles of Ecology Unit 6- Assignment 1 Homework chapters 17 and 18.docxPrinciples of Ecology Unit 6- Assignment 1 Homework chapters 17 and 18.docx
Principles of Ecology Unit 6- Assignment 1 Homework chapters 17 and 18.docx
 
Principles of Ecology Unit 8- Assignment 1 chapters 21-2-21-5 and 22.docx
Principles of Ecology Unit 8- Assignment 1 chapters 21-2-21-5 and 22.docxPrinciples of Ecology Unit 8- Assignment 1 chapters 21-2-21-5 and 22.docx
Principles of Ecology Unit 8- Assignment 1 chapters 21-2-21-5 and 22.docx
 
Principles of Ecology Unit 7- Assignment 1 chapters 19 and 21-1 Cha.docx
Principles of Ecology Unit 7- Assignment 1  chapters 19 and 21-1   Cha.docxPrinciples of Ecology Unit 7- Assignment 1  chapters 19 and 21-1   Cha.docx
Principles of Ecology Unit 7- Assignment 1 chapters 19 and 21-1 Cha.docx
 

Recently uploaded

Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 

Recently uploaded (20)

Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 

Please write in python- Thank you! Problem 6 Write down the running.docx

  • 1. Please write in python. Thank you! Problem 6 Write down the running time equation, T ( n ) , of the program do_something below. Note that list's pop takes constant ( ( 1 )) time. def do_something ( L ) : if len ( L ) < 2 : return 1 total = 0 for x in L : total + = x first = L pop ( 0 ) last = L . pop ( 1 ) if first==last: return total + do_something ( L ) else: return 2 total + do_something ( L )