1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leviafan [203]
2 years ago
5

Recall the binary search algorithm.1. Using the algorithm/algorithmic environment, give pseudocode using a for loop.AnswerMy alg

orithm for binary search using a for loop is given in Algorithm 1.Algorithm 1BinarySearchFor(A)[[XXX TODO:pseudocode here]]2. Using the algorithm/algorithmic environment, give pseudocode using a while loop.Answer[[XXX TODO:your answer here]]3. Using the algorithm/algorithmic environment, give pseudocode using recursion.Answer[[XXX TODO:your answer here]]4. What is the loop invariant of your second algorithm
Computers and Technology
1 answer:
faust18 [17]2 years ago
5 0

Answer:

Following are the Pseudo Code to the given question:

Explanation:

Following are the pseudo-code by using the For loop:

Defines the A function (node, element)

The node is larger than 0.

if another value of the node equals its element

Loop Break

That element if node. value becomes lower than that

Node is node equivalent.

right

Using other nodes is node equivalent.

 left

Node Return

If the node is vacant

print the Tree is empty

Following are the pseudo-code by using the while loop:

Defines the function A(node,element)

While this node is not zero.

if the value of the node equals the element

Loop Break

The element if node. value is lower than

Node is node equivalent.

right

Using other nodes is equivalent to an a.left node

Node Return

If the node is vacant

print Tree is empty

following are the Pseudo-code for recursion:

Set the function A (node, key)

If no root is the same as the root or no root.

return the root.

If the root value is lower than that of the quest for key return (root. right, key)

Return your lookup (root.left,key)

 

You might be interested in
Write 3 things that can't be done without technology.
bulgar [2K]

Answer:

Hacking Online Orders Math

Explanation:

4 0
2 years ago
Read 2 more answers
Consider the method get Hours, which is intended to calculate the number of hours that a vehicle takes to travel between two mil
mr Goodwill [35]

Answer:

Replace the comment with:

(c) double hours = Math.abs (marker1 - marker2) / 60.0;

Explanation:

See attachment for right presentation of question

Analyzing the options:

(a): May return a negative result

This option will return a negative value if marker1 is less than marker2 because it subtracts the absolute value of marker2 from the absolute value marker1.

This literally is not different from marker1 - marker2

(b): Incorrect expression

This divides only marker2 by 60, then subtracts the quotient from marker1. This is not the expected expression.

(c) This option is correct

This correctly calculate the positive difference between marker1 and marker2 and the result is divided by 60.0 (note 60.0 not 60)

(d) & (e) Integer division

When a variable declared as double is divided by an integer variable or value, the result of the computation is not always accurate due to approximation

7 0
2 years ago
Blair is the director of information systems at a marketing firm. She creates a set of guidelines that dictate everything an emp
gizmo_the_mogwai [7]

Answer:

data

Explanation:

Because i said so

4 0
3 years ago
Which option should you select to ignore all tracked changes in a document? To ignore all tracked changes in a document, you sho
Cloud [144]

Answer:

where is the options

Explanation:

4 0
2 years ago
What humidity level should be maintained for computing equipment? a. 50 percent b. 40 percent c. 60 percent d. 30 percent
sashaice [31]

Answer:

A. 50 percent

Explanation:

The correct option is - A. 50 percent

Another preventive measure you can take is to maintain the relative humidity at around 50 percent. Be careful not to increase the humidity too far—to the point where moisture starts to condense on the equipment.

8 0
2 years ago
Other questions:
  • You know a Linux command will perform a desired function for you, but you cannot remember the full name of the command. You do r
    14·1 answer
  • Suppose we provide a new implementation of the transport layer protocol tcp providing the same functionality using different alg
    14·1 answer
  • Why does a satellite requires two bridges?
    11·1 answer
  • How would you classify an employee who is punctual, has respect for oneself and others, and takes initiative?
    13·2 answers
  • 4-Translate the following C program to MIPS assembly program (Please explain each instruction in your code by a comment and subm
    6·1 answer
  • One common method of converting symbols into binary digits for computer processing is called ASCII​ (American Standard Code of I
    5·1 answer
  • Write a function called intersect with four float parameter
    11·1 answer
  • 2 Manter o autocontrole nos ajuda a evitar muitos problemas na nossa vida pessoal e no ambiente profissional. Em se tratando de
    14·1 answer
  • I need help I have questions I need answers in coding html,css,js and python.Fast
    7·1 answer
  • Hy plzz help me friends​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!