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
Which of the following file formats is used for art work
Dovator [93]
JPEG. It's most used for art. And PNG is used mostly in websites because it is non-lose compression.
4 0
4 years ago
Sorts by value in reverse order; keeps the same key
KATRIN_1 [288]

Answer:

rsort()

Explanation:

the sorting function is used to sort the elements in the array.

the sorting can be increasing or decreasing, depends on the function used.

let discuss the option:

a. sort()

this is the sorting function, it used to sort the array in ascending order.

b. arsort()

this is also sorting function, it used to sort the associated array in descending order according to the value.

d. asort()

this is also sorting function, it used to sort the associated array in ascending order according to the value.

c. rsort()

this is the sorting function, it used to sort the array in descending order.

Therefore, the correct answer is rsort().

4 0
3 years ago
WILL MARK BRAINLIEST FOR ANYONES ANSWER!
Anvisha [2.4K]

Answer:

just know that bit gonna be running when I make mine Imma have 720 fps btw today sponsored is nord VPN

4 0
3 years ago
A single central register of IP addresses and names (a DNS style system) is an efficient means of translating human readable nam
Harrizon [31]

Answer:

True

Explanation:

DNS stands for "Domain Name System" DNS is the system/service that is used to convert the Domain Names into IP addresses.

Whenever we write a URL to go to a web page in our browser for example Brainly(dot)com, the request first goes to a server which converts the named URL(Brainly(dot)com) into actual IP address. This actual IP address is then used to reach to the web files, as response to the URL search. This system is made to ease out the searches made by the users.

Therefore, the given statement is True.

8 0
4 years ago
Change the function definition for myint so that xyzfunc uses the same memory locations for myint as in the calling program.
sattari [20]

Answer:

b) void xyzfunc (int &myint);

Explanation:

To use the same memory location as the variable in the calling function we have to pass the variable by reference means passing the same address to the function.So to do that we have use & operator which stands for address.

We will do this as following:-

void xyzfunc (int * myint);

Hence the answer is option b.

8 0
4 years ago
Other questions:
  • Jean-Ann works in the finance business. She analyzes insurance applications in order to determine the level of risk involved in
    11·1 answer
  • _____ is a predefined format used for text the can include multiple font formatting features
    13·1 answer
  • Identify and define the various systems used in creating the Technological Systems.
    15·1 answer
  • Would a hurricane form if the humidity is really high and the breeze is very low
    11·1 answer
  • Which online article citation is correctly formatted according to MLA standards?
    15·2 answers
  • hey guys. I have bitmoji but the stickers just won't load. it says 'we couldn't retrieve you stickers, or says an error message.
    5·1 answer
  • What is an example of value created through the use of Deep Learning?​
    12·2 answers
  • What technological development happened most recently?
    12·2 answers
  • Tip of advice on brainliest.You can copy and paste the question then search it in the search bar because i can guaranty that som
    14·1 answer
  • write a recursive function that accepts an integer argument, n. the function should display n lines of asterisks on the screen,
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!