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 48 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
YES! Correct, THANKS for helping me on my review


upturnedfurball

  • Member
  • Posts: 334
Reply 3 on: Yesterday
Excellent

 

Did you know?

Adolescents often feel clumsy during puberty because during this time of development, their hands and feet grow faster than their arms and legs do. The body is therefore out of proportion. One out of five adolescents actually experiences growing pains during this period.

Did you know?

In women, pharmacodynamic differences include increased sensitivity to (and increased effectiveness of) beta-blockers, opioids, selective serotonin reuptake inhibitors, and typical antipsychotics.

Did you know?

The first war in which wide-scale use of anesthetics occurred was the Civil War, and 80% of all wounds were in the extremities.

Did you know?

Fungal nail infections account for up to 30% of all skin infections. They affect 5% of the general population—mostly people over the age of 70.

Did you know?

Hip fractures are the most serious consequences of osteoporosis. The incidence of hip fractures increases with each decade among patients in their 60s to patients in their 90s for both women and men of all populations. Men and women older than 80 years of age show the highest incidence of hip fractures.

For a complete list of videos, visit our video library