This topic contains a solution. Click here to go to the answer

Author Question: For a sorted list of 1024 elements, a binary search takes at most ________ comparisons. (Read 67 times)

maegan_martin

  • Hero Member
  • *****
  • Posts: 532

Question 1

What is the number of iterations in the following loop?

 int count = 5;
 while (count < n) {
count = count + 3;
 }

◦ n - 3
◦ n / 3 - 1
◦ (n - 5) / 3
◦ the ceiling of (n - 5) / 3
◦ n - 5

Question 2

For a sorted list of 1024 elements, a binary search takes at most ________ comparisons.
◦ 512
◦ 6
◦ 100
◦ 11


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by maegan_martin on May 6, 2020

ASDFGJLO

  • Sr. Member
  • ****
  • Posts: 335
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 49% of students answer this correctly




maegan_martin

  • Member
  • Posts: 532
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


nyrave

  • Member
  • Posts: 344
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

The average person is easily confused by the terms pharmaceutics and pharmacology, thinking they are one and the same. Whereas pharmaceutics is the science of preparing and dispensing drugs (otherwise known as the science of pharmacy), pharmacology is the study of medications.

Did you know?

Chronic necrotizing aspergillosis has a slowly progressive process that, unlike invasive aspergillosis, does not spread to other organ systems or the blood vessels. It most often affects middle-aged and elderly individuals, spreading to surrounding tissue in the lungs. The disease often does not respond to conventionally successful treatments, and requires individualized therapies in order to keep it from becoming life-threatening.

Did you know?

Long-term mental and physical effects from substance abuse include: paranoia, psychosis, immune deficiencies, and organ damage.

Did you know?

Not getting enough sleep can greatly weaken the immune system. Lack of sleep makes you more likely to catch a cold, or more difficult to fight off an infection.

Did you know?

According to animal studies, the typical American diet is damaging to the liver and may result in allergies, low energy, digestive problems, and a lack of ability to detoxify harmful substances.

For a complete list of videos, visit our video library