SlideShare a Scribd company logo
1 of 2
Consider the following questions regarding the JAVA langauge.
1. The worst case in linear search is that every element must be checked to determine whether
the search key exists, which occurs if the search key ..... (pick one)
a. is the last array element
b. is not present
c. is the last array element or is not present
d. none of the above
2. How many comparisons will the linear search algorithm make if the search key is not in an
array of 10 elements?
3. Which of the following is true? (pick one)
a. The binary search algorithm is less efficient than the linear search, but it requires that the array
be sorted.
b. The binary search algorithm is more efficient than the linear search, but it requires that the
array be unsorted.
c. The binary search algorithm is more efficient than the linear search, but it requires that the
array be sorted.
d. The binary search algorithm is less efficient than the linear search, but it requires that the array
be unsorted.
4. Which of the following is a drawback of binary search? (pick any that apply)
a. it requires significantly more memory than linear search.
b. the data must be in sorted order
c. it is slower (less efficient) than linear search
5. What is the term used for binary search's run time? (pick one)
a. constant
b. quadratic
c. linear
d. logarithmic
e. negative
Solution
1. c. is the last array element or is not present
2. 10 comparisons.
3. c. The binary search algorithm is more efficient than the linear search, but it requires that the
array be sorted.
4. b. the data must be in sorted order.
5. d. logarithmic

More Related Content

More from kaseya1

A person talking produces a sound level of 65 dB at a distance of 50 c.docx
A person talking produces a sound level of 65 dB at a distance of 50 c.docxA person talking produces a sound level of 65 dB at a distance of 50 c.docx
A person talking produces a sound level of 65 dB at a distance of 50 c.docxkaseya1
 
A metal plate is illuminated with light of a certain frequency- Which.docx
A metal plate is illuminated with light of a certain frequency- Which.docxA metal plate is illuminated with light of a certain frequency- Which.docx
A metal plate is illuminated with light of a certain frequency- Which.docxkaseya1
 
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docxA Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docxkaseya1
 
a major change in our study of differing economic systems in the era o.docx
a major change in our study of differing economic systems in the era o.docxa major change in our study of differing economic systems in the era o.docx
a major change in our study of differing economic systems in the era o.docxkaseya1
 
A leadership-motivation case is provided below- The case includes impo.docx
A leadership-motivation case is provided below- The case includes impo.docxA leadership-motivation case is provided below- The case includes impo.docx
A leadership-motivation case is provided below- The case includes impo.docxkaseya1
 
A kettle is filled with tap water and placed on a stove- The stove ele.docx
A kettle is filled with tap water and placed on a stove- The stove ele.docxA kettle is filled with tap water and placed on a stove- The stove ele.docx
A kettle is filled with tap water and placed on a stove- The stove ele.docxkaseya1
 
A photographer works part-time in a shopping center- 2 hours per day-.docx
A photographer works part-time in a shopping center- 2 hours per day-.docxA photographer works part-time in a shopping center- 2 hours per day-.docx
A photographer works part-time in a shopping center- 2 hours per day-.docxkaseya1
 
Consider the following definitions for linked lists for problems 6 thr.docx
Consider the following definitions for linked lists for problems 6 thr.docxConsider the following definitions for linked lists for problems 6 thr.docx
Consider the following definitions for linked lists for problems 6 thr.docxkaseya1
 
Consider the following chemical compounds- Classify each as either an.docx
Consider the following chemical compounds- Classify each as either an.docxConsider the following chemical compounds- Classify each as either an.docx
Consider the following chemical compounds- Classify each as either an.docxkaseya1
 
Consider the plane R2 and consider any two lines that pass through the.docx
Consider the plane R2 and consider any two lines that pass through the.docxConsider the plane R2 and consider any two lines that pass through the.docx
Consider the plane R2 and consider any two lines that pass through the.docxkaseya1
 
Consider the following statements about the investment in working capi.docx
Consider the following statements about the investment in working capi.docxConsider the following statements about the investment in working capi.docx
Consider the following statements about the investment in working capi.docxkaseya1
 
Consider the following method definitions intended to find the smalles.docx
Consider the following method definitions intended to find the smalles.docxConsider the following method definitions intended to find the smalles.docx
Consider the following method definitions intended to find the smalles.docxkaseya1
 
Consider relations R and S as following and answer question- R A B 1 2 (8).docx
Consider relations R and S as following and answer question- R A B 1 2 (8).docxConsider relations R and S as following and answer question- R A B 1 2 (8).docx
Consider relations R and S as following and answer question- R A B 1 2 (8).docxkaseya1
 

More from kaseya1 (13)

A person talking produces a sound level of 65 dB at a distance of 50 c.docx
A person talking produces a sound level of 65 dB at a distance of 50 c.docxA person talking produces a sound level of 65 dB at a distance of 50 c.docx
A person talking produces a sound level of 65 dB at a distance of 50 c.docx
 
A metal plate is illuminated with light of a certain frequency- Which.docx
A metal plate is illuminated with light of a certain frequency- Which.docxA metal plate is illuminated with light of a certain frequency- Which.docx
A metal plate is illuminated with light of a certain frequency- Which.docx
 
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docxA Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
A Martian leaves Mars in a spaceship that is heading to Venus- On the.docx
 
a major change in our study of differing economic systems in the era o.docx
a major change in our study of differing economic systems in the era o.docxa major change in our study of differing economic systems in the era o.docx
a major change in our study of differing economic systems in the era o.docx
 
A leadership-motivation case is provided below- The case includes impo.docx
A leadership-motivation case is provided below- The case includes impo.docxA leadership-motivation case is provided below- The case includes impo.docx
A leadership-motivation case is provided below- The case includes impo.docx
 
A kettle is filled with tap water and placed on a stove- The stove ele.docx
A kettle is filled with tap water and placed on a stove- The stove ele.docxA kettle is filled with tap water and placed on a stove- The stove ele.docx
A kettle is filled with tap water and placed on a stove- The stove ele.docx
 
A photographer works part-time in a shopping center- 2 hours per day-.docx
A photographer works part-time in a shopping center- 2 hours per day-.docxA photographer works part-time in a shopping center- 2 hours per day-.docx
A photographer works part-time in a shopping center- 2 hours per day-.docx
 
Consider the following definitions for linked lists for problems 6 thr.docx
Consider the following definitions for linked lists for problems 6 thr.docxConsider the following definitions for linked lists for problems 6 thr.docx
Consider the following definitions for linked lists for problems 6 thr.docx
 
Consider the following chemical compounds- Classify each as either an.docx
Consider the following chemical compounds- Classify each as either an.docxConsider the following chemical compounds- Classify each as either an.docx
Consider the following chemical compounds- Classify each as either an.docx
 
Consider the plane R2 and consider any two lines that pass through the.docx
Consider the plane R2 and consider any two lines that pass through the.docxConsider the plane R2 and consider any two lines that pass through the.docx
Consider the plane R2 and consider any two lines that pass through the.docx
 
Consider the following statements about the investment in working capi.docx
Consider the following statements about the investment in working capi.docxConsider the following statements about the investment in working capi.docx
Consider the following statements about the investment in working capi.docx
 
Consider the following method definitions intended to find the smalles.docx
Consider the following method definitions intended to find the smalles.docxConsider the following method definitions intended to find the smalles.docx
Consider the following method definitions intended to find the smalles.docx
 
Consider relations R and S as following and answer question- R A B 1 2 (8).docx
Consider relations R and S as following and answer question- R A B 1 2 (8).docxConsider relations R and S as following and answer question- R A B 1 2 (8).docx
Consider relations R and S as following and answer question- R A B 1 2 (8).docx
 

Recently uploaded

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 

Consider the following questions regarding the JAVA langauge- 1- The w.docx

  • 1. Consider the following questions regarding the JAVA langauge. 1. The worst case in linear search is that every element must be checked to determine whether the search key exists, which occurs if the search key ..... (pick one) a. is the last array element b. is not present c. is the last array element or is not present d. none of the above 2. How many comparisons will the linear search algorithm make if the search key is not in an array of 10 elements? 3. Which of the following is true? (pick one) a. The binary search algorithm is less efficient than the linear search, but it requires that the array be sorted. b. The binary search algorithm is more efficient than the linear search, but it requires that the array be unsorted. c. The binary search algorithm is more efficient than the linear search, but it requires that the array be sorted. d. The binary search algorithm is less efficient than the linear search, but it requires that the array be unsorted. 4. Which of the following is a drawback of binary search? (pick any that apply) a. it requires significantly more memory than linear search. b. the data must be in sorted order c. it is slower (less efficient) than linear search 5. What is the term used for binary search's run time? (pick one) a. constant b. quadratic c. linear
  • 2. d. logarithmic e. negative Solution 1. c. is the last array element or is not present 2. 10 comparisons. 3. c. The binary search algorithm is more efficient than the linear search, but it requires that the array be sorted. 4. b. the data must be in sorted order. 5. d. logarithmic