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]
3 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]3 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
if you want to exclude a portion of an image which option should be chosen?? A. Arrange B. Position C. Crop D. Delete
Anuta_ua [19.1K]
It would be C- crop. This allows you to specifically delete parts of the image using drag and drop features. Hope this helps!
3 0
3 years ago
Omar wants to add transitions to his presentation, so he clicks the Transitions tab. Which tasks can he now complete? Check all
ser-zykov [4K]

Answer:

a b c and d

Explanation:

edgunity 2020

7 0
3 years ago
5.4.6: Rolling Dice code
ziro4ka [17]
It is 15 all together
4 0
3 years ago
COULD U ANSWER THIS ???
vladimir1956 [14]

Answer:

B.lightning striking a tree

Explanation:

The crowd dispersing in all directions is not a closed-loop by any means, and students jogging around an oval track as well is not a closed-loop, and also not a cross country run from one point to another. However, the lightning striking a tree is a closed loop that best models a circuit. And as lightning strikes the tree, like a closed circuit, tree catches the fire, or in circuitry words, the current is generated, and tree catches the fire due to it, just like bulb starts glowing.

3 0
3 years ago
Jeff decides that he would pay as much as $3,000 for a new laptop computer. He buys the computer and realizes consumer surplus o
Lady_Fox [76]

Jeff pay $2,300 for his computer.

b. $2,300

<u>Explanation:</u>

Consumer surplus can be defined as the amount that the consumer is willing to pay for a product or a service. The word surplus is a synonym for something extra or excess. It corresponds to the extra benefit that the consumer gets while buying something which may be the result of some discount, sale, or negotiation.  

Jeff realizes a consumer surplus of $700 while purchasing a laptop of $3000. As the consumer surplus is $700,

the amount Jeff has paid for the laptop is: $3000 - $700

                                          : $2300

6 0
3 years ago
Other questions:
  • Select all ways that databases may help you manage and manipulate data and records.
    11·1 answer
  • Determine and prove whether an argument in English is valid or invalid. About Prove whether each argument is valid or invalid. F
    5·1 answer
  • Which one is a run-on sentence? you get mark the brilist
    5·2 answers
  • Graphs and charts are two different elements. True or False
    15·1 answer
  • The customer's endpoint device on the wan is called the __________________.​
    11·1 answer
  • Does anyone have the GCSE 2018 Design Technology J310/01 practice paper?
    15·1 answer
  • 19. Fair use applies to which of the following situations?
    14·1 answer
  • What is software infrastructure?
    15·1 answer
  • URGENT!!! Steve wants to change shooting and exposure settings while on his photo shoot. Which camera part will allow him to do
    12·2 answers
  • Describe the functions of a system software​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!