SlideShare a Scribd company logo
1 of 1
Download to read offline
Java Foundations
Write a recursive definition of i * j (integer multiplication), where i > 0. Define the
multiplication process in terms of integer addition. For example, 4 * 7 is equal to 7 added to
itself 4 times. (Hint: Do one addition operator in each recursive invocation.)
Write a recursive method to reverse a string. Explain why you would not normally use recursion
to solve this problem. (Hint: Write one character in each recursive invocation.)

More Related Content

More from ambersushil

Jet blue airways, con sede en Nueva York, hab�a comenzado 2007 en ra.pdf
Jet blue airways, con sede en Nueva York, hab�a comenzado 2007 en ra.pdfJet blue airways, con sede en Nueva York, hab�a comenzado 2007 en ra.pdf
Jet blue airways, con sede en Nueva York, hab�a comenzado 2007 en ra.pdf
ambersushil
 
JavaCreate a java application using the code example in the follo.pdf
JavaCreate a java application using the code example in the follo.pdfJavaCreate a java application using the code example in the follo.pdf
JavaCreate a java application using the code example in the follo.pdf
ambersushil
 
Java Question---------------------------FacebookApp(Main).jav.pdf
Java Question---------------------------FacebookApp(Main).jav.pdfJava Question---------------------------FacebookApp(Main).jav.pdf
Java Question---------------------------FacebookApp(Main).jav.pdf
ambersushil
 
Java AssignmentUsing the ListNode.java file below Write method.pdf
Java AssignmentUsing the ListNode.java file below Write method.pdfJava AssignmentUsing the ListNode.java file below Write method.pdf
Java AssignmentUsing the ListNode.java file below Write method.pdf
ambersushil
 

More from ambersushil (20)

Johanna Murray, una activista clim�tica en The National Footprint Fo.pdf
Johanna Murray, una activista clim�tica en The National Footprint Fo.pdfJohanna Murray, una activista clim�tica en The National Footprint Fo.pdf
Johanna Murray, una activista clim�tica en The National Footprint Fo.pdf
 
Joannie est� en la categor�a impositiva del 15. Trabaja para una em.pdf
Joannie est� en la categor�a impositiva del 15. Trabaja para una em.pdfJoannie est� en la categor�a impositiva del 15. Trabaja para una em.pdf
Joannie est� en la categor�a impositiva del 15. Trabaja para una em.pdf
 
Joan accompanies her husband Dan to the clinic and reports to the nu.pdf
Joan accompanies her husband Dan to the clinic and reports to the nu.pdfJoan accompanies her husband Dan to the clinic and reports to the nu.pdf
Joan accompanies her husband Dan to the clinic and reports to the nu.pdf
 
Jim blindfolds Dwight and gives him a 4lb weight to hold. He then ta.pdf
Jim blindfolds Dwight and gives him a 4lb weight to hold. He then ta.pdfJim blindfolds Dwight and gives him a 4lb weight to hold. He then ta.pdf
Jim blindfolds Dwight and gives him a 4lb weight to hold. He then ta.pdf
 
Jill and Jim are married and they have 2 children (Josh and Kenny). .pdf
Jill and Jim are married and they have 2 children (Josh and Kenny). .pdfJill and Jim are married and they have 2 children (Josh and Kenny). .pdf
Jill and Jim are married and they have 2 children (Josh and Kenny). .pdf
 
Jet blue airways, con sede en Nueva York, hab�a comenzado 2007 en ra.pdf
Jet blue airways, con sede en Nueva York, hab�a comenzado 2007 en ra.pdfJet blue airways, con sede en Nueva York, hab�a comenzado 2007 en ra.pdf
Jet blue airways, con sede en Nueva York, hab�a comenzado 2007 en ra.pdf
 
Jerrold tiene una filosof�a con respecto a la retenci�n de empleados.pdf
Jerrold tiene una filosof�a con respecto a la retenci�n de empleados.pdfJerrold tiene una filosof�a con respecto a la retenci�n de empleados.pdf
Jerrold tiene una filosof�a con respecto a la retenci�n de empleados.pdf
 
Jes�s Mart�nez es un hombre hispano de 46 a�os de su unidad. Ingres�.pdf
Jes�s Mart�nez es un hombre hispano de 46 a�os de su unidad. Ingres�.pdfJes�s Mart�nez es un hombre hispano de 46 a�os de su unidad. Ingres�.pdf
Jes�s Mart�nez es un hombre hispano de 46 a�os de su unidad. Ingres�.pdf
 
Jeremiah Restoration Company completed the following selected transa.pdf
Jeremiah Restoration Company completed the following selected transa.pdfJeremiah Restoration Company completed the following selected transa.pdf
Jeremiah Restoration Company completed the following selected transa.pdf
 
Jeremy est� considerando usar mucho el color blanco en el logotipo p.pdf
Jeremy est� considerando usar mucho el color blanco en el logotipo p.pdfJeremy est� considerando usar mucho el color blanco en el logotipo p.pdf
Jeremy est� considerando usar mucho el color blanco en el logotipo p.pdf
 
JenkinsWe have two dozen APIs to deploy, and the dev team was able.pdf
JenkinsWe have two dozen APIs to deploy, and the dev team was able.pdfJenkinsWe have two dozen APIs to deploy, and the dev team was able.pdf
JenkinsWe have two dozen APIs to deploy, and the dev team was able.pdf
 
Jefferson Tutoring had the following payroll information on February.pdf
Jefferson Tutoring had the following payroll information on February.pdfJefferson Tutoring had the following payroll information on February.pdf
Jefferson Tutoring had the following payroll information on February.pdf
 
Javier volunteers in community events each month. He does not do mor.pdf
Javier volunteers in community events each month. He does not do mor.pdfJavier volunteers in community events each month. He does not do mor.pdf
Javier volunteers in community events each month. He does not do mor.pdf
 
javaSuppose that you have a reference to a node in a singly linke.pdf
javaSuppose that you have a reference to a node in a singly linke.pdfjavaSuppose that you have a reference to a node in a singly linke.pdf
javaSuppose that you have a reference to a node in a singly linke.pdf
 
JAVAXMLNeed help. Trying to have the user to tap on an imageview .pdf
JAVAXMLNeed help. Trying to have the user to tap on an imageview .pdfJAVAXMLNeed help. Trying to have the user to tap on an imageview .pdf
JAVAXMLNeed help. Trying to have the user to tap on an imageview .pdf
 
JavaCreate a java application using the code example in the follo.pdf
JavaCreate a java application using the code example in the follo.pdfJavaCreate a java application using the code example in the follo.pdf
JavaCreate a java application using the code example in the follo.pdf
 
Java Programming.Im working on making a Polynomial class and Node.pdf
Java Programming.Im working on making a Polynomial class and Node.pdfJava Programming.Im working on making a Polynomial class and Node.pdf
Java Programming.Im working on making a Polynomial class and Node.pdf
 
java language1)implement a method that splits a circularly linked .pdf
java language1)implement a method that splits a circularly linked .pdfjava language1)implement a method that splits a circularly linked .pdf
java language1)implement a method that splits a circularly linked .pdf
 
Java Question---------------------------FacebookApp(Main).jav.pdf
Java Question---------------------------FacebookApp(Main).jav.pdfJava Question---------------------------FacebookApp(Main).jav.pdf
Java Question---------------------------FacebookApp(Main).jav.pdf
 
Java AssignmentUsing the ListNode.java file below Write method.pdf
Java AssignmentUsing the ListNode.java file below Write method.pdfJava AssignmentUsing the ListNode.java file below Write method.pdf
Java AssignmentUsing the ListNode.java file below Write method.pdf
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 

Recently uploaded (20)

OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 

Java FoundationsWrite a recursive definition of i j (integer mul.pdf

  • 1. Java Foundations Write a recursive definition of i * j (integer multiplication), where i > 0. Define the multiplication process in terms of integer addition. For example, 4 * 7 is equal to 7 added to itself 4 times. (Hint: Do one addition operator in each recursive invocation.) Write a recursive method to reverse a string. Explain why you would not normally use recursion to solve this problem. (Hint: Write one character in each recursive invocation.)