SlideShare una empresa de Scribd logo
1 de 2
Use the code below to answer questions 1 through 3:
What is the time complexity of silly1 (give tightest big O)?
What is the time complexity of silly2 (give tightest big O)?
What is the time complexity of silly3 (give tightest big O)?
public static void silly1(int n) t for (int i = 0; i 0) t System.out.println("j - "j); public static void
silly2(int n) for (int k = n; k > 0; k--){ for (int i = 0; i
Solution
1 ANS::: for loop run N times
while loop run N+1 TIMES
TOTAL N(N+1)=N^2+N = O(N^2);
2 ANS::::::
N+1 * N *N=O(N^3)
3 ANS:::::
HERE 1ST FOR LOOP N+1 TIMES
AND ADD 2ND LOOP N TIMES
TOTAL N+1+N=O(N)
Use the code below to answer questions 1 through 3- What is the time c.docx

Más contenido relacionado

Más de rtodd63

Type your question here Does the table represent an exponential functi.docx
Type your question here Does the table represent an exponential functi.docxType your question here Does the table represent an exponential functi.docx
Type your question here Does the table represent an exponential functi.docxrtodd63
 
ty ty +x +X SolutionLet- mass of each rod - m - M length of each rod -.docx
ty ty +x +X SolutionLet- mass of each rod - m - M length of each rod -.docxty ty +x +X SolutionLet- mass of each rod - m - M length of each rod -.docx
ty ty +x +X SolutionLet- mass of each rod - m - M length of each rod -.docxrtodd63
 
True-False (a) Ganymede is the only known satellite to have an intrins.docx
True-False (a) Ganymede is the only known satellite to have an intrins.docxTrue-False (a) Ganymede is the only known satellite to have an intrins.docx
True-False (a) Ganymede is the only known satellite to have an intrins.docxrtodd63
 
True or false- If true or false state your reason- 2 lanes are subspa.docx
True or false- If true or false state your reason-  2 lanes are subspa.docxTrue or false- If true or false state your reason-  2 lanes are subspa.docx
True or false- If true or false state your reason- 2 lanes are subspa.docxrtodd63
 
true or false The Doppler effect is a change in frequency due to the r.docx
true or false The Doppler effect is a change in frequency due to the r.docxtrue or false The Doppler effect is a change in frequency due to the r.docx
true or false The Doppler effect is a change in frequency due to the r.docxrtodd63
 
tte - -----rrof- tot i aoTA- South L has an anday ebretro chon Hrd dio.docx
tte - -----rrof- tot i aoTA- South L has an anday ebretro chon Hrd dio.docxtte - -----rrof- tot i aoTA- South L has an anday ebretro chon Hrd dio.docx
tte - -----rrof- tot i aoTA- South L has an anday ebretro chon Hrd dio.docxrtodd63
 
True or False 1- One good feature about memory-memory instruction set.docx
True or False 1- One good feature about memory-memory instruction set.docxTrue or False 1- One good feature about memory-memory instruction set.docx
True or False 1- One good feature about memory-memory instruction set.docxrtodd63
 

Más de rtodd63 (7)

Type your question here Does the table represent an exponential functi.docx
Type your question here Does the table represent an exponential functi.docxType your question here Does the table represent an exponential functi.docx
Type your question here Does the table represent an exponential functi.docx
 
ty ty +x +X SolutionLet- mass of each rod - m - M length of each rod -.docx
ty ty +x +X SolutionLet- mass of each rod - m - M length of each rod -.docxty ty +x +X SolutionLet- mass of each rod - m - M length of each rod -.docx
ty ty +x +X SolutionLet- mass of each rod - m - M length of each rod -.docx
 
True-False (a) Ganymede is the only known satellite to have an intrins.docx
True-False (a) Ganymede is the only known satellite to have an intrins.docxTrue-False (a) Ganymede is the only known satellite to have an intrins.docx
True-False (a) Ganymede is the only known satellite to have an intrins.docx
 
True or false- If true or false state your reason- 2 lanes are subspa.docx
True or false- If true or false state your reason-  2 lanes are subspa.docxTrue or false- If true or false state your reason-  2 lanes are subspa.docx
True or false- If true or false state your reason- 2 lanes are subspa.docx
 
true or false The Doppler effect is a change in frequency due to the r.docx
true or false The Doppler effect is a change in frequency due to the r.docxtrue or false The Doppler effect is a change in frequency due to the r.docx
true or false The Doppler effect is a change in frequency due to the r.docx
 
tte - -----rrof- tot i aoTA- South L has an anday ebretro chon Hrd dio.docx
tte - -----rrof- tot i aoTA- South L has an anday ebretro chon Hrd dio.docxtte - -----rrof- tot i aoTA- South L has an anday ebretro chon Hrd dio.docx
tte - -----rrof- tot i aoTA- South L has an anday ebretro chon Hrd dio.docx
 
True or False 1- One good feature about memory-memory instruction set.docx
True or False 1- One good feature about memory-memory instruction set.docxTrue or False 1- One good feature about memory-memory instruction set.docx
True or False 1- One good feature about memory-memory instruction set.docx
 

Último

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
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
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Último (20)

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
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"
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
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
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 

Use the code below to answer questions 1 through 3- What is the time c.docx

  • 1. Use the code below to answer questions 1 through 3: What is the time complexity of silly1 (give tightest big O)? What is the time complexity of silly2 (give tightest big O)? What is the time complexity of silly3 (give tightest big O)? public static void silly1(int n) t for (int i = 0; i 0) t System.out.println("j - "j); public static void silly2(int n) for (int k = n; k > 0; k--){ for (int i = 0; i Solution 1 ANS::: for loop run N times while loop run N+1 TIMES TOTAL N(N+1)=N^2+N = O(N^2); 2 ANS:::::: N+1 * N *N=O(N^3) 3 ANS::::: HERE 1ST FOR LOOP N+1 TIMES AND ADD 2ND LOOP N TIMES TOTAL N+1+N=O(N)