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

Author Question: The following is the pseudocode for which type of algorithm?Set first to 0Set last to the last ... (Read 60 times)

SGallaher96

  • Hero Member
  • *****
  • Posts: 509
The following is the pseudocode for which type of algorithm?
Set first to 0
Set last to the last subscript in the array
Set found to false
Set position to -1
While found is not true and first is less than or equal to last    
     Set middle to the subscript halfway between array[first] and array[last]
     If array[middle] equals the desired value
          Set found to true
          Set position to middle
     Else If array[middle] is greater than the desired value
          Set last to middle - 1
     Else
          Set first to middle + 1
     End If
End While
Return position

◦ linear search
◦ selection sort
◦ linear sort
◦ binary search
◦ None of these


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by SGallaher96 on May 22, 2019

mcabuhat

  • Sr. Member
  • ****
  • Posts: 344
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 29% of students answer this correctly




SGallaher96

  • Member
  • Posts: 509
Reply 2 on: May 22, 2019
:D TYSM


Joy Chen

  • Member
  • Posts: 354
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

Women are two-thirds more likely than men to develop irritable bowel syndrome. This may be attributable to hormonal changes related to their menstrual cycles.

Did you know?

ACTH levels are normally highest in the early morning (between 6 and 8 A.M.) and lowest in the evening (between 6 and 11 P.M.). Therefore, a doctor who suspects abnormal levels looks for low ACTH in the morning and high ACTH in the evening.

Did you know?

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

Did you know?

About one in five American adults and teenagers have had a genital herpes infection—and most of them don't know it. People with genital herpes have at least twice the risk of becoming infected with HIV if exposed to it than those people who do not have genital herpes.

Did you know?

As many as 20% of Americans have been infected by the fungus known as Histoplasmosis. While most people are asymptomatic or only have slight symptoms, infection can progress to a rapid and potentially fatal superinfection.

For a complete list of videos, visit our video library