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 49 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


ttt030911

  • Member
  • Posts: 315
Reply 3 on: Yesterday
Gracias!

 

Did you know?

Limit intake of red meat and dairy products made with whole milk. Choose skim milk, low-fat or fat-free dairy products. Limit fried food. Use healthy oils when cooking.

Did you know?

There are major differences in the metabolism of morphine and the illegal drug heroin. Morphine mostly produces its CNS effects through m-receptors, and at k- and d-receptors. Heroin has a slight affinity for opiate receptors. Most of its actions are due to metabolism to active metabolites (6-acetylmorphine, morphine, and morphine-6-glucuronide).

Did you know?

Medication errors are more common among seriously ill patients than with those with minor conditions.

Did you know?

Nitroglycerin is used to alleviate various heart-related conditions, and it is also the chief component of dynamite (but mixed in a solid clay base to stabilize it).

Did you know?

Vaccines cause herd immunity. If the majority of people in a community have been vaccinated against a disease, an unvaccinated person is less likely to get the disease since others are less likely to become sick from it and spread the disease.

For a complete list of videos, visit our video library