Recursion is a natural use for a _____ (stack or queue)

Answers

Answer 1

Answer:

Stack

Explanation:

Any function that call itself can be regarded as recursive function, it should be noted that Recursion is a natural use for a stack, especially in the area of book keeping.

Recursion is very important because some of problems are usually recursive in nature such as Graph and others, and when dealing with recursion , only base and recursive case is needed to be defined.

Some areas where recursion is used are in sorting and searching.


Related Questions

A coach wants to divide the basketball team into two groups for a practice game. Which statistical measurement is the coach most likely to use?
A) percentile
B) mean
C) median
D) mode

Answers

Answer:

median

Explanation:

Answer:

C) Median

Explanation:

Which of the following HTML structures arranges text in multiple rows and columns?
a.
b.
c.
d.

Answers

Answer:

b. <table>

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

Generally, all HTML documents are divided into two (2) main parts; body and head. The head contains information such as version of HTML, title of a page, metadata, link to custom favicons and CSS etc. The body of the HTML document contains the contents or informations of a web page to be displayed.

A <table> is a HTML structure that arranges text in multiple rows and columns. Other data that can be arranged into rows and columns in a HTML table are images, links, and other tables. Each row in a table is denoted with a <tr> tag.

Does the submission include the file "SuperPower.java"? Does the file include a public class called "SuperPower"? Does the class include a public method called "main"? Is the "main" method static? Does the main method have a String assignment statement that uses "JOptionPane.showInputDialog"? Does the main method have a statement that uses "JOptionPane.showMessageDialog"? Does the program convert the String from "JOptionPane.showInputDialog" using the "toUpperCase" method? Does the submission include a screenshot that shows an Input dialog that asks, "What is your superpower?" Does the submission include a screenshot that shows a Message dialog stating " TO THE RESCUE!", where "" is the input converted to upper case?

Answers

Answer:    

Here is the program fulfilling all the requirements given:

import javax.swing.JOptionPane;      

public class SuperPower{

public static void main(String[] args) {

String power;

power = JOptionPane.showInputDialog("What is your super power?");

power = power.toUpperCase();

JOptionPane.showMessageDialog(null, power);} }

Explanation:

Does the file include a public class called "SuperPower"

See the statement:

public class SuperPower

Does the class include a public method called "main"? Is the "main" method static?

See the statement:

public static void main(String[] args)

Does the main method have a String assignment statement that uses "JOptionPane.showInputDialog"

See the statement:

power = JOptionPane.showInputDialog("What is your super power?");

Does the main method have a statement that uses "JOptionPane.showMessageDialog"?

See the statement:

JOptionPane.showMessageDialog(null, power);

Does the program convert the String from "JOptionPane.showInputDialog" using the "toUpperCase" method?

See the statement:

power = power.toUpperCase();

Does the submission include a screenshot that shows an Input dialog that asks, "What is your superpower?" Does the submission include a screenshot that shows a Message dialog stating " TO THE RESCUE!", where "" is the input converted to upper case?

See the attached screenshots

If the program does not let you enter an exclamation mark after "to the rescue" then you can alter the code as follows:

import javax.swing.JOptionPane;

public class SuperPower{

public static void main(String[] args) {

String power;

power = JOptionPane.showInputDialog("What is your super power?");

power = power.toUpperCase();

JOptionPane.showMessageDialog( null, power+"!");} } // here just add an exclamation mark which will add ! after the string stored in  power

C# The video game machine at your local arcade output coupons according to how well you play the game. You can redeem 10 coupons for a candy bar or 3 coupons for a gumball. You prefer candy bars to gumballs. Write a program that defines a variable initially assigned to the number of coupons you win. Next, the program should output how many candy bars and gumballs you can get if you spend all of your coupons on candy bars first, and any remaining coupons on gumballs.

Answers

Answer:

#include<iostream>

using namespace std;

/* main is a function without a parameters which returns an int value*/

int main( )

{

/* declare int data type for numeric values initialize candyBar and gumBall */

int coupons, cabdyBr=10,gumall=3;

int candyBarAmount,gumBallAmount,remainder;

/* cout is used to show the message to user cin to read user input from keyboard and sets the value to coupon */

cout<<"Enter the number of coupons"\t";

cin>>coupons;

/* First check coupons with cabdyBar */

if (coupons >= candyBar)

{

candyBarAmount=coupons/candyBar;

remainder=coupons-(candyBarAmount*10);

}

else

{

candyBarAmount=0;

}

/* check remaining value with gumBall */

if (remainder<<candyBar && remainder>=gumBall)

{

gumBallAmount=remainder/gumball;

}

else

{

gumBallAmount=0;

}

/* show thw required output to the user */

cout<<"The number of Candy bars is "<< candyBarAmount <<endl;

cout<<"The number of gumballs is "<<gumballAmount <<endl;

/* The program ends and return 0 as the functions value */

return 0;

}

OUTPUT

Enter the number of coupons: 23

The number of candy bars = 2

The number of gumballs = 1

What are the differences between an Api Controller and "regular/view" Controller in .Net?

Answers

Answer:

An API controller in .Net is a code statement or function that returns data and a RESTful API to the application while a regular or view controller is a class that returns a view.

Explanation:

The .Net framework is a platform used for creating user-friendly and user interactive interfaces in desktop and web applications. Like all programming frameworks, it uses API and API controllers to source data and other properties.

Maia wants to left align her paragraphs. Which button does she press?
o

Answers

the answer is the 2nd one because the 2nd and 4th line is moved over to the left

Answer:

It's B

Explanation:

On edge 2021

Read the following code:

x = currentAge
print(x + 20)

What value will this code calculate?

Select one:
a. Age in 20 years
b. Age 20 years ago
c. Age at 20 years old
d. Age in the year 2020

Answers

Answer:

The answer is "A) Age in 20 years"

Explanation:

Assuming currentAge is declared and is an integer, you are adding 20 to your current age which means it will print your age in 20 years.

Its Option A - Age in 20 Years.
Thank You!

A disadvantage to using open source software is

it may restrict your ability to customize the software to suit your needs.

a higher level of technical skill may be required to install, use, or modify it.

you will need to find the developers who created the software to request their permission to reuse the source code.

you can use the software only if you make a donation to an open-source nonprofit organization

Answers

Answer: a higher level of technical skill may be required to install, use, or modify it.

Explanation:

Answer:

B. a higher level of technical skill may be required to install, use, or modify it.

Explanation:

Digital information processed into a useful form is

Answers

Answer:

Output

Explanation:

1) You have a class called Sheep that wants to keep track of how many Sheep have ever been created. Where is a good place to put that variable? 2) When an h file mentions another class, what is that called? (When a cpp file needs to use a class, they include it. This is an h file just mentioning a class, like it has a pointer of that type. You are promising the compiler that the class is in another file.) 3) What is a good guideline for deciding you must write a copy constructor, an assignment operator, and a destructor? 4) void Rock::Func( const Rock & X){} What is that argument type called and what does it do? 5) We saw overloading the = sign. How do you declare a class wanting to override the parenthesis operator?

Answers

Answer:

The counter variable for the sheep count should be declared and initialized before the constructor in the class. The extern keyword should be used to declare the class in the receiving C source file. A constructor is defined when there is a need to instantiate an object with an argument and an assignment operator is used to initialize a variable. The const keyword is used to specify a variable whose value should not change during the course of the program execution.

Explanation:

The C programming language is an object-oriented programming language and has variable specifiers to define variable scopes in a program.

A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one liter of milk and the profit of each carton of milk vary from farm to farm. Write a program that prompts the user to enter: The total amount of milk produced in the morning. The cost of producing one liter of milk. The profit on each carton of milk. The program then outputs: The number of milk cartons needed to hold milk. Round your answer to the nearest integer. The cost of producing milk. The profit for producing milk.

Answers

Answer:

milk_produced = float(input("Enter the total amount of milk produced in the morning: "))

liter_cost = float(input("Enter the cost of producing one liter of milk: "))

carton_profit = float(input("Enter the profit on each carton of milk: "))

carton_needed = round(milk_produced / 3.78)

cost = milk_produced * liter_cost

profit = carton_profit * carton_needed

print("The number of milk cartons needed to hold milk is " + str(carton_needed))

print("The cost of producing milk is " + str(cost))

print("The profit for producing milk is " + str(profit))

Explanation:

*The code is in Python.

Ask the user to enter milk_produced, liter_cost and carton_profit

Calculate the number of milk cartons needed, divide the milk_produced by the capacity (3.78) of a cartoon and round the result

Calculate the cost, multiply the milk_produced by liter_cost

Calculate the profit, multiply the carton_profit by carton_needed

Print the results

Using computer software, compare the 2016 year-to-date sales through February to the 2017 year-to-date sales through February for each manufacturer by computing the difference. Using computer software, sort the list of the manufacturers in order of largest to smallest difference in year-to-date sales. Which manufacturers are in the top five with increased sales

Answers

Incomplete question. Here's a similar question found in the attachments.

Answer:

General Motors Corp, Chrysler, Ford Motor Company, Toyota Motors sales USA Inc, Nissan North America Inc.

Explanation:

By, using the MS Excel computer software, you would be able to compare the 2016 year-to-date sales through February 2017 year-to-date sales for each manufacturer.

Simply copy the data into the data cells of MS Excel, next use the =sum formula (which should have a minus sign; For example, =SUM (B5 - E5) would give you the difference between the 2016 sales and 2017 sales, only if sales for 2016 is found in column B row 5 and sales for 2017 in column E row 5).

Thus, the results obtained can further be evaluated to determine the manufacturers in the top five with increased sales.

>>> from hog import *
>>> test_dice = make_test_dice(4, 6, 1)
>>> test_dice()______
>>> test_dice() # Second call
______
>>> test_dice() # Third call______
>>> test_dice() # Fourth call

Answers

Answer:

This Python code is an implementation of an anonymous function like a lambda function in other function.

Explanation:

The function 'make_test_dice' with the arguments 4, 6 and 1, returns a lambda function to the test_dice variable.

The test_dice is called with parenthesis to run the lambda function. This implementation is used to hide a parameter in a calculation or process.

the time a computer takes to start has increased dramatically, one possible explanation for this is that the computer is running out of memory. this explanation is a scientific....
a. hypothesis
b. experiment
c. observation
d. conclusion

Answers

Answer:

A

Explanation:

The appropriate answer will be Option c (observation).

Being able to comprehend or recognize something or be able to notice it his ability to observe in great depth is evident in every explanation or statement, which would be determined as an Observation.The result of observing or noting something, and then forming or expressing a judgment or a king of opinion.

The other given choices,

Experiment or hypothesis - Tests are used to examine a hypothesis or maybe even a concept through the utilization of such an experiment.

Conclusion - The final component of anything or a conclusion made following considerable deliberation.

Are not related to the given scenario. Thus the above option is the right one.

Learn more about observational learning here:

https://brainly.com/question/21861086

Imagine you were using some of our pixelation tools to create an image and you posted it online for your friends to see - but, a week later you find out someone took that image and put it on a T-shirt that they’re selling for $10 each.


Now that we understand Copyright, what would need to change in order for the scenario from the warm-up to be okay?

Answers

Answer:

I will develop a CREATIVE COMMONS LICENSE

Explanation:

Based on the scenario given what i would need to change for the scenario from the warm-up to be okay is for me develop CREATIVE COMMONS LICENSE and the reason why I would develop this type of license is that it will enable people or the public to freely make use of my work or have free licence to the work that I have created by freely using it on their own products which will enables them to sell their work which have my own work on them easily and freely without any form of restrictions.

Copyright allows the creator or owner of a property (usually intellectual property) to have an absolute right over his property.

What needs to be done in this scenario is to create a creative common license.

In copyright, creative common license allows the members of the public to make use of an intellectual property for free, while the owner still retains the ownership and right, over the property.

When the creative common license is done, the seller of the T-shirt can sell the T-shirt without remitting any incentive to you; however, the seller gives you credit and recognition for the image.

Read more about copyrights at:

https://brainly.com/question/17357239

Question 4
When something is saved to the cloud, it means it's stored on Internet servers
instead of on your computer's hard drive.

Answers

Answer:

Wait is this a question or are you for real

Answer:it is stored on the internet server instead

of your computer's hard drive.

Explanation:

the cloud is the Internet—more specifically, it's all of the things you can access remotely over the Internet.

A file with a com extension is most likely to be a(n) ___ file.

Answers

I think that the answer is: A executable

Complete the statement below with the correct term.

A single-mode
uses a single ray of light, called a mode, to transmit data.

Answers

Answer:

Its Fiber

Explanation:

Trust me

Answer:

Data transfer through the core using a single light ray (the ray is also called a mode).

The core diameter is around 10 microns.

At distances up to 3 km, single mode delivers data rates up to 10 Gbps.

Cable lengths can extend a great distance. Or FIBER

Explanation:

hope this helps

Input a double and print the first two digits after the decimal point with a space between them. Sample run: Please input a decimal number: 57.8934 Answer: 8 9 Hint - to complete the second coding activity in lesson 5 you had to learn how to get individual digits from an int value. You can reuse this method once you convert the user input to an appropriate int value (you will need both multiplication and casting for this).

Answers

Answer:

number = float(input("Please input a decimal number: "))

number = int (number * 100)

second_digit = number % 10

first_digit = int(number / 10) % 10

print("Answer: " + str(first_digit) + " " + str(second_digit))

Explanation:

Ask the user to enter a decimal number (number = 57.8934)

Multiply it by 100 (number = 5789.34) and typecast to int (number = 5789)

Use the module to get the second digit (9)

Divide the number by 10 (578.9), typecast to int (578) and use module operator to get the first digit (8)

Print the numbers as requested

The code is:

int main(){

double n;

int v, d;

scanf("%lf\n", &n);

n = n*10;

v = (int)n;

d = v%10;

printf("The first digit is %d\n", d);

n = n*10;

v = (int)n;

d = v%10;

printf("The second digit is %d\n", d);

return 0;

}

----------------------

To get each decimal digit, we multiply by 10 until the digit, then calculate the remainder of the operation(mod) of the integer part relative to 10.For example:

57.8934 x 10 = 578.934

The integer part is 578.

The remainder of the division of 578 by 10 is 8.

Now, we have to generalize it, thus:

int main(){

double n;

int v, d;

scanf("%lf\n", &n); -> Reads the double;

/*First digit*/

n = n*10; -> Multiplies by 10.

v = (int)n; -> Casts the integer part

d = v%10; 0 -> Remainder relative to 10 to get the first digit.

printf("The first digit is %d\n", d);

/*Second digit -> Does the same thing*/

n = n*10; -> Multiplies by 10.

v = (int)n; -> Casts the integer part

d = v%10; 0 -> Remainder relative to 10 to get the first digit.

printf("The second digit is %d\n", d);

return 0;

}

A similar problem is given at https://brainly.com/question/18340665

identify the benefit of modeling to communicate a solution. ​

Answers

Answer:

provides a graphical design or representation of solution with symbols.

Explanation:

Communication models help identify and understand the components and relationship of the communication process being studied. Models represent new ideas and thought on various aspects of communication which helps us to plan for effective communication system.

Answer: D

Explanation:

can someone explain to me what coom means? kekw

Answers

If it is espanish it is como and it means how.

Answer:

Outside of referring to the image and meme, Coomer, often lowercased as coomer, is used online as a general insult for an overshrexed young man. The term implies such a person is a sleazy loser, obsessed with masturbatling to pronography because he can't find shrexual partners.

Which of the following is NOT a popular computer programming
language?
C++
Xero
C#
Java

Answers

Answer is Xero. All the other Languages are Popular and Widely Used.
Thank You!

The computer programming  language i.e. not popular is Xero.

The following are the popular computer programming  language:

C++C#Java

The computer programming  language is the language that is applying for writing the programs.

Therefore we can conclude that the computer programming  language i.e. not popular is Xero.

Learn more about the computer here: brainly.com/question/24504878

Chunking is a good strategy for completing large assignments because it makes the work
O less boring.
more thorough.
less difficult
O more manageable.

Answers

I think it would be the fourth answer choice.

Answer:

D. more manageable

Explanation:

it wouldn't make the work less boring, wont make work less difficult and and it wont help u get more through quicker

To the greatest extent possible, coalition members should _____.

Answers

Answer: consider the ramifications of labeling information about operational areas as intelligence

Explanation:

The options to the question are:

a. consider the ramifications of labeling information about operational areas as intelligence

b. prevent the sharing of relevant intelligence about the situation and adversary

c. occasionally seek the necessary authorization for foreign disclosure of information

d. disseminate information freely without a tear line.

To the greatest extent possible, coalition members should, consider the ramifications of labeling information about operational areas as intelligence.

It should be noted that security operations activities are conducted by U.S. forces in order to demonstrate the commitment of the U.S to its alliances, and also enhance regional stability.

The parameter passing mechanisn used in C is

Answers

Answer:

Hope you understand this answer

Pass by value is the answer

ethical issues of cyber bullying

Answers

Answer:

Explanation: As a student, I am aware of the existence of Cyber-bullying and the manner in which it can be carried out. I am also sensitive to the serious nature of the problem. However, I realise that I need to know more about the issue if I am to be effective in fostering a supportive learning environment in which students can grow as good digital citizens.

Cyber-bullying is similar to traditional psychological bullying in that-

There is an imbalance of power between the victim & perpetrator.

Victims draw negative attention & are isolated from their peer group.

Perpetrators are often encouraged & supported by their peer group.

The actions of the perpetrator are deliberate, repeated & relentless.

The negative attention is uninvited & unwanted by the victim.

The effects often cause depression, anxiety, low self-esteem, poorer mental & physical health and school avoidance.

cellular digestion associated by what organelles?​

Answers

Answer:

lysosomes

Explanation:

Cell Digestion and the Secretory Pathway. The primary sites of intracellular digestion are organelles known as the lysosomes, which are membrane-bounded compartments containing a variety of hydrolytic enzymes.

It it associated with lysosomes

Which symbol is at the beginning and end of a multiline comment block?

Answers

The beginning of a block comment or a multi-line comment is marked by the symbol /* and the symbol */ marks its end.

Instructions
Currently, this program will add 6 and 3 together, output the math problem and output the answer. Edit this code so that a random number is generated from 1 - 10 (inclusive) for the variables a and b. Also, instead of adding the two numbers together, the edited program should multiply them, and output the proper math problem and answer. Be sure to update every line of code to reflect the changes needed. import random

Answers

Answer:

The original program is not given; So, I'll just write the program myself in python

import random

x = random.randint(1,10)

y = random.randint(1,10)

result = x * y

print(str(y)+" * "+str(x)+" = "+str(result))

Explanation:

The first line imports random

import random

The next two line generates random numbers between 1 and 10 and save in variables x and y

x = random.randint(1,10)

y = random.randint(1,10)

This line multiplies both numbers

result = x * y

This line prints the result

print(str(y)+" * "+str(x)+" = "+str(result))

The modified program written in python 3 is given below :

import random # import the random module for generating random numbers

a = random.randint(1, 11)#a random integer value between the values (1 and 10) is attached to variable a

b = random.randint(1,11)#a random integer value between the values (1 and 10) is attached to variable b

answer = a * b# multiplies the value of a and b and attach the result to the variable answer

print(str(a) + " * " + str(b) + " = " + str(answer))#displays the operation and result obtained as a string.

Learn more on python programs :https://brainly.com/question/16674303

What does the security element of non-repudiation mean in e-commerce cybersecurity? A. Data needs to be available at all times. B. Only authorized personnel can access data. C. Each website should have privacy control settings. D. Clients cannot refuse to make payments once they place an order.

Answers

Answer:

Non-repudiation is the assurance that someone cannot deny the validity of something. Non-repudiation is a legal concept that is widely used in information security and refers to a service, which provides proof of the origin of data and the integrity of the data

Explanation:

Answer:

Clients cannot refuse to make payments once they place an order.

Explanation:

PLATO Cyber-security

I got 5/5 on the quiz.

Other Questions
What animal made huntIng easier for the plains Native Americans what are some culture differences between Mexico and the U.S A trumpet player on a moving railroad flatcar moves toward a second trumpet player standing alongside the track both play a 490 Hz note. The sound waves heard by a stationary observer between the two players have a beat frequency of 2.0 beats/s. What is the flatcar's speed? Take the speed of sound to be 343 m/s. In a lab, a substance is heated by 4C each hour for 28 hours. What was the total change in temperature? Which statement best describes a similarity between voting in the US and in other democratic countries?O In some countries, citizens do not have the right to vote.O In some countries, citizens have the right to vote but choose not to.O In some countries, citizens vote for communist leaders.O In some countries, citizens vote for monarchs. hey can someone help me? The three properties of color are hue, value, and intensity.TrueFalse The table shows the blood types of 75 donors after a one-day blood drive. Based on results, what is the chance that a random donor has type A blood? Blood Type A B AB Frequency 31 33 9 2 31 33 25 75 Pls help will mark brainliest in which quadrant does the point s(-3, -4) lie? what is the area of a pizza with a 9 inch radius? Highlight descriptive details about Charley. Charley is a born diplomat. He prefers negotiation to fighting, and properly so, since he is very bad at fighting. Only once in his ten years has he been in trouble when he met a dog who refused to negotiate. Charley lost a piece of his right ear that time. But he is a good watch dog has a roar like a lion, designed to conceal from night-wandering strangers the fact that he couldn't bite his way out of a cornet de papier. Travels with Charley, John Steinbeck What is most likely Steinbecks purpose in writing this description of Charley? to convince the reader that Charley is a good traveling companion and friend to warn of the dangers of traveling with dogs to explain of the dangers of traveling alone without a companion to demonstrate that French dogs often feel out of place in America A building is 1 ft from a 11-ft fence that surrounds the property. A worker wants to wash a window in the building 14 ft from the ground. He plans to place a ladder over the fence so it rests against the building. He decides he should place the ladder 9 ft from the fence for stability. To the nearest tenth of a foot, how long a ladder will he need if AN OBJECT HAS ZERO NET FORCE ON IT THEN THE OBJECT MUST BE AT REST true or false HAVE ANY OF YALL READ SONGBIRDS AND SNAKES FROM THE HUNGER GAMES?? *answer if u have* 1. According to the above map, which of the following economic commodities did the Englishcolonies contribute to the triangular trade pattern that developed in the mercantilist systembetween Europe, Africa and the Americas? a. manufactured goodsb. slave laborc. natural resourcesd. weapons An investor has sold 1 ABC Jan 50 Call and has bought 1 ABC Apr 60 Call. This is a:________.a. Combinationb. horizontal spreadc. dialogue spreadd. straddle Which best describes the dimensions of a plane?O A plane has zero dimensions because it represents a location on the coordinate plane.A plane has one dimension because it is made up of an infinite number of points.O Aplane has two dimensions because it is a flat surface that has length and width but no depth.O A plane has three dimensions because it is made up of exactly three noncollinear points. Note: Enter your answer and show all the steps that you use to solve this problem in the space provided.For the following number pattern,13, 16, 19, 22, 25 . . .write the next three termswrite a rule to describe the number pattern Which of the following is a quality of Texas Natives?