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
Ilia_Sergeevich [38]
3 years ago
13

Design a recursive version of the Euclidean algorithm

Computers and Technology
1 answer:
Margaret [11]3 years ago
7 0
Here's a recursive Python program that finds the greatest common denominator:

#!/usr/bin/python

import sys

def gcdR( x, y ):
    if( y ):
        return( gcdR( y, x % y ) )
    return x
       

if( __name__ == "__main__" ):
    x = max( int( sys.argv[ 1 ] ), int( sys.argv[ 2 ] ) )
    y = min( int( sys.argv[ 1 ] ), int( sys.argv[ 2 ] ) )

    print gcdR( y, x % y )

    sys.exit( 0 )


You might be interested in
When excel imports an access table, the data is placed in a worksheet _____?
ratelena [41]
Book is the answer!!!!!
3 0
4 years ago
In java write a program:A contact list is a place where you can store a specific contact with other associated information such
BigorU [14]

Answer:

import java.util.Scanner;

public class ContactInformation

{

public static String GetPhoneNumber(String[] nameVec, String[] phoneNumberVec, String contactName, int arraySize)  

{  

for(int i=0;i<arraySize;i++)

{

if(nameVec[i].equals(contactName))  

return phoneNumberVec[i];

}  

return "Contact doesn't exists!";

}

public static void main(String[] args)

{

int records;

Scanner sc = new Scanner(System.in);

System.out.print("Enter the size of contact List :");

records=sc.nextInt();

String[] contactNameList=new String[records];

String[] phoneNumberList=new String[records];

String contactName;

System.out.println("Enter the contact name and phone number :");

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

{  

contactNameList[i]=sc.next();  

phoneNumberList[i]=sc.next();  

}  

System.out.println("Enter the name of the contact to be searched :");  

contactName=sc.next();

System.out.println(GetPhoneNumber(contactNameList,phoneNumberList,contactName,records));  

}  

}

Explanation:

In the following the function defined above for getting the contact

number on the basis of contact number provided we are checking the contact name list if we are able to find the contact name and if we did we return the contact number on the same index from the contact number list

which we found in the contact name list.

4 0
3 years ago
What is the difference between paper size and page margins in word
yKpoI14uk [10]
Paper size is how big or small the paper is whilst paper margin is the staight lines or shapes at the sides of a page or sheet.
6 0
3 years ago
Read 2 more answers
9. If you want to change the Header text of any Form then which property will you use
Lady_Fox [76]

Answer:

header

Explanation:

i would use header

8 0
3 years ago
Use the VBA Editor to create a new module. Type the following VBA code to createa custom depreciation function (be sure to inclu
zalisa [80]

Many Microsoft Access users are experienced with using macros to automate activities, but they are not knowledgeable with module code or the Visual Basic for Applications (VBA) programming language.

Many Microsoft Access users are experienced with using macros to automate activities, but they are not knowledgeable with module code or the Visual Basic for Applications (VBA) programming language.  All Microsoft Office products employ the VBA programming language. You can utilize it in Word documents, Excel spreadsheets, PowerPoint presentations, and Outlook in addition to Access. Additionally, Visual Basic 6's language and VBA's are highly similar. In actuality, the integrated development environment (IDE) and syntax editor are nearly identical.

The creation of macros is simple and involves selecting options from drop-down menus. It's simple to see the possibilities available after choosing an action and choose the best decision.

Know more about programming language:

brainly.com/question/23959041

#SPJ4

5 0
1 year ago
Other questions:
  • PLEASE HELP Which of the following is considered a modern method of communication?
    6·2 answers
  • How do I learn coding??? ​
    5·2 answers
  • Your laptop doesn't have a serial port. what type of connector will your laptop require
    6·1 answer
  • Approximately what percent of desktop PCs are used for work-related purposes?
    12·1 answer
  • Write a program that performs the following tasks: Display a friendly greeting to the user Prompt the user for the value to conv
    13·1 answer
  • Tom and his brother caught 100 finish on a weeklong fishing trip. The total way of the fish was 235 pounds. What is the weight o
    9·1 answer
  • Code written by computer programmers is translated to binary code, so computers can understand the instructions. True or False
    7·1 answer
  • Keyshia wants to add movement to her PowerPoint presentation. Which tab should she use to complete this task
    15·2 answers
  • Write a recursive decent algorithm for a java while statement, a Javas if statement , an logical/mathematical expression based o
    5·1 answer
  • Customer history is an example of what
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!