SlideShare a Scribd company logo
1 of 1
Download to read offline
public static ArrayList doArrayListSearchSmallest(int numItems) {
System.out.print("doArrayListSearchSmallest: ");
ArrayList list = new ArrayList<>();
// TODO Write code that adds integers 0 through (numitems - 1)
// to list.
long startTime = getTimestamp();
// TODO Write code that gets the element at the first index from list.
long endTime = getTimestamp();
long totalTime = endTime - startTime;
System.out.println(totalTime);
return list;
}
Solution
Code that adds integers 0 through (numitems - 1) to the list. I have added a loop for adding
values to the list.
for(int i=0; i doArrayListAdd(int numItems) {
System.out.print("doArrayListAdd: ");
ArrayList list = new ArrayList<>();
long startTime = getTimestamp();
for(int i=0; i

More Related Content

More from birajdar2

Consider the following segment table What are the physical addresse.pdf
Consider the following segment table  What are the physical addresse.pdfConsider the following segment table  What are the physical addresse.pdf
Consider the following segment table What are the physical addresse.pdfbirajdar2
 
Can you explain the movement of ions and ion channel activity during.pdf
Can you explain the movement of ions and ion channel activity during.pdfCan you explain the movement of ions and ion channel activity during.pdf
Can you explain the movement of ions and ion channel activity during.pdfbirajdar2
 
Calculate the implied stock price assuming an EBITDA multiple of 11..pdf
Calculate the implied stock price assuming an EBITDA multiple of 11..pdfCalculate the implied stock price assuming an EBITDA multiple of 11..pdf
Calculate the implied stock price assuming an EBITDA multiple of 11..pdfbirajdar2
 
Below is the graph of a polynomial function f with real coefficients.pdf
Below is the graph of a polynomial function f with real coefficients.pdfBelow is the graph of a polynomial function f with real coefficients.pdf
Below is the graph of a polynomial function f with real coefficients.pdfbirajdar2
 
Are higher than average sea surface temperatures associated with a g.pdf
Are higher than average sea surface temperatures associated with a g.pdfAre higher than average sea surface temperatures associated with a g.pdf
Are higher than average sea surface temperatures associated with a g.pdfbirajdar2
 
A table of values of an increasing function F is shown. Use the table.pdf
A table of values of an increasing function F is shown. Use the table.pdfA table of values of an increasing function F is shown. Use the table.pdf
A table of values of an increasing function F is shown. Use the table.pdfbirajdar2
 
A polygenic trait is determined by a single gene with many different.pdf
A polygenic trait is determined by a single gene with many different.pdfA polygenic trait is determined by a single gene with many different.pdf
A polygenic trait is determined by a single gene with many different.pdfbirajdar2
 
4. Phil is conducting a seed germination experiment. He places 3 gro.pdf
4. Phil is conducting a seed germination experiment. He places 3 gro.pdf4. Phil is conducting a seed germination experiment. He places 3 gro.pdf
4. Phil is conducting a seed germination experiment. He places 3 gro.pdfbirajdar2
 
21. What is the relationship between the maximum size of aggregates a.pdf
21. What is the relationship between the maximum size of aggregates a.pdf21. What is the relationship between the maximum size of aggregates a.pdf
21. What is the relationship between the maximum size of aggregates a.pdfbirajdar2
 
Which of the following are organizer molecules in the avian PMZ is a.pdf
Which of the following are organizer molecules in the avian PMZ is a.pdfWhich of the following are organizer molecules in the avian PMZ is a.pdf
Which of the following are organizer molecules in the avian PMZ is a.pdfbirajdar2
 
What are the five stages of team development Describe each stage an.pdf
What are the five stages of team development Describe each stage an.pdfWhat are the five stages of team development Describe each stage an.pdf
What are the five stages of team development Describe each stage an.pdfbirajdar2
 
What kinds of molecules can be used as metabolic fuel to produce ATP.pdf
What kinds of molecules can be used as metabolic fuel to produce ATP.pdfWhat kinds of molecules can be used as metabolic fuel to produce ATP.pdf
What kinds of molecules can be used as metabolic fuel to produce ATP.pdfbirajdar2
 
1. Choose the best answer for each statmentquestion.a.) Which sta.pdf
1. Choose the best answer for each statmentquestion.a.) Which sta.pdf1. Choose the best answer for each statmentquestion.a.) Which sta.pdf
1. Choose the best answer for each statmentquestion.a.) Which sta.pdfbirajdar2
 
1) What does the nonbranching proposal say about split-brain patient.pdf
1) What does the nonbranching proposal say about split-brain patient.pdf1) What does the nonbranching proposal say about split-brain patient.pdf
1) What does the nonbranching proposal say about split-brain patient.pdfbirajdar2
 
What are the levels of biodiversity. And how are they valuable Drag.pdf
What are the levels of biodiversity. And how are they valuable  Drag.pdfWhat are the levels of biodiversity. And how are they valuable  Drag.pdf
What are the levels of biodiversity. And how are they valuable Drag.pdfbirajdar2
 
Two students were debating how to classify superscalar operation ver.pdf
Two students were debating how to classify superscalar operation ver.pdfTwo students were debating how to classify superscalar operation ver.pdf
Two students were debating how to classify superscalar operation ver.pdfbirajdar2
 
Throughout the semester, we have been working on command line applic.pdf
Throughout the semester, we have been working on command line applic.pdfThroughout the semester, we have been working on command line applic.pdf
Throughout the semester, we have been working on command line applic.pdfbirajdar2
 
the formula to compute the spending multiplier isSolutionS.pdf
the formula to compute the spending multiplier isSolutionS.pdfthe formula to compute the spending multiplier isSolutionS.pdf
the formula to compute the spending multiplier isSolutionS.pdfbirajdar2
 
The figure illustrates an interaction between a(n) CTL and its tar.pdf
The figure illustrates an interaction between a(n)  CTL and its tar.pdfThe figure illustrates an interaction between a(n)  CTL and its tar.pdf
The figure illustrates an interaction between a(n) CTL and its tar.pdfbirajdar2
 
The implementation for Mergesort given in Section 7.4 takes an array .pdf
The implementation for Mergesort given in Section 7.4 takes an array .pdfThe implementation for Mergesort given in Section 7.4 takes an array .pdf
The implementation for Mergesort given in Section 7.4 takes an array .pdfbirajdar2
 

More from birajdar2 (20)

Consider the following segment table What are the physical addresse.pdf
Consider the following segment table  What are the physical addresse.pdfConsider the following segment table  What are the physical addresse.pdf
Consider the following segment table What are the physical addresse.pdf
 
Can you explain the movement of ions and ion channel activity during.pdf
Can you explain the movement of ions and ion channel activity during.pdfCan you explain the movement of ions and ion channel activity during.pdf
Can you explain the movement of ions and ion channel activity during.pdf
 
Calculate the implied stock price assuming an EBITDA multiple of 11..pdf
Calculate the implied stock price assuming an EBITDA multiple of 11..pdfCalculate the implied stock price assuming an EBITDA multiple of 11..pdf
Calculate the implied stock price assuming an EBITDA multiple of 11..pdf
 
Below is the graph of a polynomial function f with real coefficients.pdf
Below is the graph of a polynomial function f with real coefficients.pdfBelow is the graph of a polynomial function f with real coefficients.pdf
Below is the graph of a polynomial function f with real coefficients.pdf
 
Are higher than average sea surface temperatures associated with a g.pdf
Are higher than average sea surface temperatures associated with a g.pdfAre higher than average sea surface temperatures associated with a g.pdf
Are higher than average sea surface temperatures associated with a g.pdf
 
A table of values of an increasing function F is shown. Use the table.pdf
A table of values of an increasing function F is shown. Use the table.pdfA table of values of an increasing function F is shown. Use the table.pdf
A table of values of an increasing function F is shown. Use the table.pdf
 
A polygenic trait is determined by a single gene with many different.pdf
A polygenic trait is determined by a single gene with many different.pdfA polygenic trait is determined by a single gene with many different.pdf
A polygenic trait is determined by a single gene with many different.pdf
 
4. Phil is conducting a seed germination experiment. He places 3 gro.pdf
4. Phil is conducting a seed germination experiment. He places 3 gro.pdf4. Phil is conducting a seed germination experiment. He places 3 gro.pdf
4. Phil is conducting a seed germination experiment. He places 3 gro.pdf
 
21. What is the relationship between the maximum size of aggregates a.pdf
21. What is the relationship between the maximum size of aggregates a.pdf21. What is the relationship between the maximum size of aggregates a.pdf
21. What is the relationship between the maximum size of aggregates a.pdf
 
Which of the following are organizer molecules in the avian PMZ is a.pdf
Which of the following are organizer molecules in the avian PMZ is a.pdfWhich of the following are organizer molecules in the avian PMZ is a.pdf
Which of the following are organizer molecules in the avian PMZ is a.pdf
 
What are the five stages of team development Describe each stage an.pdf
What are the five stages of team development Describe each stage an.pdfWhat are the five stages of team development Describe each stage an.pdf
What are the five stages of team development Describe each stage an.pdf
 
What kinds of molecules can be used as metabolic fuel to produce ATP.pdf
What kinds of molecules can be used as metabolic fuel to produce ATP.pdfWhat kinds of molecules can be used as metabolic fuel to produce ATP.pdf
What kinds of molecules can be used as metabolic fuel to produce ATP.pdf
 
1. Choose the best answer for each statmentquestion.a.) Which sta.pdf
1. Choose the best answer for each statmentquestion.a.) Which sta.pdf1. Choose the best answer for each statmentquestion.a.) Which sta.pdf
1. Choose the best answer for each statmentquestion.a.) Which sta.pdf
 
1) What does the nonbranching proposal say about split-brain patient.pdf
1) What does the nonbranching proposal say about split-brain patient.pdf1) What does the nonbranching proposal say about split-brain patient.pdf
1) What does the nonbranching proposal say about split-brain patient.pdf
 
What are the levels of biodiversity. And how are they valuable Drag.pdf
What are the levels of biodiversity. And how are they valuable  Drag.pdfWhat are the levels of biodiversity. And how are they valuable  Drag.pdf
What are the levels of biodiversity. And how are they valuable Drag.pdf
 
Two students were debating how to classify superscalar operation ver.pdf
Two students were debating how to classify superscalar operation ver.pdfTwo students were debating how to classify superscalar operation ver.pdf
Two students were debating how to classify superscalar operation ver.pdf
 
Throughout the semester, we have been working on command line applic.pdf
Throughout the semester, we have been working on command line applic.pdfThroughout the semester, we have been working on command line applic.pdf
Throughout the semester, we have been working on command line applic.pdf
 
the formula to compute the spending multiplier isSolutionS.pdf
the formula to compute the spending multiplier isSolutionS.pdfthe formula to compute the spending multiplier isSolutionS.pdf
the formula to compute the spending multiplier isSolutionS.pdf
 
The figure illustrates an interaction between a(n) CTL and its tar.pdf
The figure illustrates an interaction between a(n)  CTL and its tar.pdfThe figure illustrates an interaction between a(n)  CTL and its tar.pdf
The figure illustrates an interaction between a(n) CTL and its tar.pdf
 
The implementation for Mergesort given in Section 7.4 takes an array .pdf
The implementation for Mergesort given in Section 7.4 takes an array .pdfThe implementation for Mergesort given in Section 7.4 takes an array .pdf
The implementation for Mergesort given in Section 7.4 takes an array .pdf
 

Recently uploaded

Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsPallavi Parmar
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfKartik Tiwari
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 

Recently uploaded (20)

Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell Tolls
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 

public static ArrayListInteger doArrayListSearchSmallest(int nu.pdf

  • 1. public static ArrayList doArrayListSearchSmallest(int numItems) { System.out.print("doArrayListSearchSmallest: "); ArrayList list = new ArrayList<>(); // TODO Write code that adds integers 0 through (numitems - 1) // to list. long startTime = getTimestamp(); // TODO Write code that gets the element at the first index from list. long endTime = getTimestamp(); long totalTime = endTime - startTime; System.out.println(totalTime); return list; } Solution Code that adds integers 0 through (numitems - 1) to the list. I have added a loop for adding values to the list. for(int i=0; i doArrayListAdd(int numItems) { System.out.print("doArrayListAdd: "); ArrayList list = new ArrayList<>(); long startTime = getTimestamp(); for(int i=0; i