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
Georgia [21]
3 years ago
8

If Laura wanted to solve a problem using recursion where the last statement executed is the call to the same method, what type o

f recursion should she use?
A. tail method

B. tail recursion

C. base recursion

D. infinite recursion
Computers and Technology
1 answer:
GREYUIT [131]3 years ago
3 0

Answer:

B: Tail recursion

Explanation:

The answer is tail recursion because in python, tail recursive function is defined as the function when the recursive call is the last thing that will be executed by the given function in question.

This definition tallies with the definition we have in the question.

So, option B is correct.

You might be interested in
Which computer are used by mobile employees such as meter readers.​
Naily [24]

Answer:

Handheld/Mobile Computers

3 0
3 years ago
Read 2 more answers
Write a program that uses an STL List of integers. a. The program will insert two integers, 5 and 6, at the end of the list. Nex
poizon [28]

Answer:

answer:

#include <iostream>

#include<list>

using namespace std;

bool Greater(int x) { return x>3; } int main() { list<int>l; /*Declare the list of integers*/ l.push_back(5); l.push_back(6); /*Insert 5 and 6 at the end of list*/ l.push_front(1); l.push_front(2); /*Insert 1 and 2 in front of the list*/ list<int>::iterator it = l.begin(); advance(it, 2); l.insert(it, 4); /*Insert 4 at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl; l.erase(it); /*Delete the element 4 inserted at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl;

l.remove_if(Greater); for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " ";

/*Display the list*/

cout<<endl; return 0;

}

5 0
3 years ago
Read 2 more answers
Create a logic array qualifyingIndex with true for any location where the runner is male with a running time less than 8.2. Row
larisa [96]

Rounding Numbers

Say you wanted to round the number 838.274. Depending on which place value you'll round to, the final result will vary. Rounding 838.274:

Rounding to the nearest hundred is 800

Rounding to the nearest ten is 840

Rounding to the nearest one is 838

Rounding to the nearest tenth is 838.3

Rounding to the nearest hundredth is 838.27

5 0
3 years ago
Cd-roms typically use the _______ filesystem type.
marissa [1.9K]
CD-<span>ROMs typically use the ____ filesystem type</span>
8 0
3 years ago
Code a complete Java program to load and process a 1-dimensional array.
zepelin [54]

Answer:

Here you go.Consider giving brainliest if it helped.

Explanation:

import java.io.*;//include this header for the file operation

import java.util.*;//to perform java utilities

import javax.swing.JOptionPane;//needed fro dialog box

class Driver{

  public static void main(String args[]){

      int wages[]=new int[15];//array to hold the wages

      int index=0;

      try{

          //use try catch for the file operation

          File file=new File("wages.txt");

          Scanner sc=new Scanner(file);//pass the file object to the scanner to ready values

          while(sc.hasNext()){

              String data=sc.nextLine();//reads a wage as a string

              String w=data.substring(1);//remove the dollar from the string data

              wages[index++]=Integer.parseInt(w);//convert the wage to int and store it in the array

          }

          sc.close();//close the scanner

      }catch(FileNotFoundException e){

          System.out.println("Error Occurrred While Reading File");

      }

     

      //sort the array using in built sort function

      Arrays.sort(wages);

      //print the wages

      System.out.println("Wages of 15 person in ascending order:");

      for(int i=0;i<wages.length;i++){

          System.out.print("$"+wages[i]+" ");

      }

      //call the increases wages method

      wages=increaseWages(wages);//this method return the updated wages array

     

  }

 

  //since we can call only static methods from main hence increaseWages is also static

  public static int[] increaseWages(int wages[]){

      //increase the wages

      for(int i=0;i<wages.length;i++){

          wages[i]+=500;

      }

     

      //print the new wages

      int sum=0;

      System.out.println("\n\nNew wages of 15 person in ascending order:");

      for(int i=0;i<wages.length;i++){

          sum+=wages[i];//sums up the new wages

          System.out.print("$"+wages[i]+" ");

      }

     

      //display the summation of the new wages in a dialog box

      JOptionPane.showMessageDialog(null,"Total of new wages: "+sum);

      return wages;

  }

}

6 0
3 years ago
Other questions:
  • When you declare an array, _____________________ You always reserve memory for it in the same statement You might reserve memory
    9·1 answer
  • How do you think your ability to work might be affected if you don’t magnify a document so that text is at a size for you to rea
    9·1 answer
  • You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
    13·1 answer
  • What takes information entered into a given system and sends it automatically to all upstream systems and processes?
    6·2 answers
  • Two communicating devices are using a single-bit even parity check for error detection. The transmitter sends the byte 10101010
    8·1 answer
  • While the names for Web addresses, or URLs, are not case-sensitive, the names for files you create for the Web are. 
    11·1 answer
  • Exercise#3: Write a program that performs the following: Declare a two arrays called arrayA and arrayB that holds integer and th
    14·2 answers
  • Which option best explains the goal of computer science?
    9·1 answer
  • Which of the following correctly orders the units of measure from least to greatest?
    7·2 answers
  • Define CPU and its functions​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!