Examlex

Solved

The Following Is the Pseudocode for Which Type of Algorithm

question 2

Multiple Choice

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


Definitions:

Clerical Job

A clerical job involves office-based tasks such as typing, filing, handling and processing paperwork, and possibly managing office equipment and databases.

Ethical

Pertaining to morals, principles of right and wrong, or the philosophy regarding moral conduct.

Sales Clerk

A retail worker responsible for assisting customers, conducting sales transactions, and maintaining the sales floor's organization.

NASW Code of Ethics

A document that outlines the ethical principles and standards that guide the professional conduct of social workers, emphasizing principles like social justice, dignity and worth of the person, and the importance of human relationships.

Related Questions