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
Image-editing software is used to _____.
bulgar [2K]

Answer:

B)enhance a photograph

3 0
2 years ago
Read 2 more answers
What are two advantages of a pay-for-use online conferencing service compared to a free service? (Choose two)
tester [92]

Answer:

Provision of both audio and video

,dedicated support

Explanation:

Free services are not dedicated digital lines so there is no guarantee of high-quality sound or a reliable connection during the call. Some common issues  are background noises, crackling, echoes, distortion, quietness and drop-outs.Free services also don't offer dedicated support so if anything goes wrong there's nobody available to help you. Any of these problems can ruin the productivity and flow of your meeting.

5 0
3 years ago
What is one advantage and disadvantage of designing a support security that might be based on a centralized model, where all sen
defon

Co-Ordination Difficulty: ...
Waste of Resources: ...
Larger Interests of the Enterprise Neglected: ...
Emergency Decision not Possible: ...
Lack of Qualified Managers: ...
Certain Activities Decentralization not Possible:
8 0
2 years ago
Your brother is starting 9th grade next year and is thinking about going to college. What step would you recommend he take?
postnew [5]
I would say D. Usually students aren't expected to fill out the FAFSA till junior or senior year, this is because it is based on household income which may change every year. Also, guidance counselor's can help students on the right track to go to classes. Clubs and/or sports teams look really good on college applications and are usually preferred by colleges. 
4 0
2 years ago
Consider the system of simultaneous equations:
FromTheMoon [43]

Answer:

System of linear equations is solved below and explained in detail.

Explanation:

Part a:

M = [1  3  5  2; 2  -4  7  -3; 0  -4  -7  3; 5  -3  2  1];

c =  [7;  -3;  -1;  0];

Part b:

The statement used for the solution of system of linear equation will be:

X = linsolve(M,c)

where X will give the values of x1, x2, x3, x4 respectively.

Part c:

The system is solved in matlab using above equation and the results are attached in a file.

The values for X are:

x1 = -2/7

x2 = 3/7

x3 = 4/7

x4 = 11/7

4 0
3 years ago
Other questions:
  • What device brocasts all data packets to other nodes on a network?
    5·1 answer
  • 18 Select the correct answer.
    5·1 answer
  • Wap-enabled devices require a ________, a special web browser that has all the features of computer-based browsers but is simpli
    11·1 answer
  • Given the function definition below, what is the effect of thecall:
    7·2 answers
  • Given :an int variable k,an int array currentMembers that has been declared and initialized ,an int variable nMembers that conta
    12·1 answer
  • Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive). Sample output w
    12·1 answer
  • Intuitively, which of the following would happen to e⃗ net if d became very large?
    6·1 answer
  • Where are the worksheet tabs located
    7·1 answer
  • If I'm screen sharing and I plug in a HDMI, will it screen share what the HDMI is plugged into, and can you talk at the same tim
    11·1 answer
  • The _____________computer function accepts data from input devices and sends it to the computer processor.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!