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


xthemafja

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

 

Did you know?

All patients with hyperparathyroidism will develop osteoporosis. The parathyroid glands maintain blood calcium within the normal range. All patients with this disease will continue to lose calcium from their bones every day, and there is no way to prevent the development of osteoporosis as a result.

Did you know?

The heart is located in the center of the chest, with part of it tipped slightly so that it taps against the left side of the chest.

Did you know?

Asthma-like symptoms were first recorded about 3,500 years ago in Egypt. The first manuscript specifically written about asthma was in the year 1190, describing a condition characterized by sudden breathlessness. The treatments listed in this manuscript include chicken soup, herbs, and sexual abstinence.

Did you know?

An identified risk factor for osteoporosis is the intake of excessive amounts of vitamin A. Dietary intake of approximately double the recommended daily amount of vitamin A, by women, has been shown to reduce bone mineral density and increase the chances for hip fractures compared with women who consumed the recommended daily amount (or less) of vitamin A.

Did you know?

Vaccines prevent between 2.5 and 4 million deaths every year.

For a complete list of videos, visit our video library