SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
use recursion to convert prefix expressions directly to postfix expressions. You may not use a
stack as you did in Lab 1.
Write a Java program that accepts a prefix expression containing single letter operands and the
operators +, -, *, /, and $ (representing exponentiation). Output the corresponding postfix
expression.
For example, if your input is *AB then output should be AB*. Output of BA* is considered
incorrect.
In your analysis, be sure to discuss why recursion makes sense. Consider your recursive solution
with your iterative solution from Lab 1. Is one better than the other? DO you feel differntly than you
didi when you wrote Lab 1. Tell us what you learned and what you would do differently. Be sure to
review the Programming Assignment Guidelines for specific requirements for the Analysis and
before submitting this assignment.
Input File:
*AB
-+ABC
-A+BC
$+-ABC+D-EF
-*A$B+C-DE*EF
**A+BC+C-BA
/A+BC +C*BA
*-*-ABC+BA
/+/A-BC-BA
*$A+BC+C-BA
//A+B0-C+BA
*$A^BC+C-BA

Más contenido relacionado

Más de adityknits

Using a company that you know or fictitious company briefly .pdf
Using a company that you know or fictitious company briefly .pdfUsing a company that you know or fictitious company briefly .pdf
Using a company that you know or fictitious company briefly .pdfadityknits
 
UserInputHandlerjava package midterm2023 import javautil.pdf
UserInputHandlerjava package midterm2023 import javautil.pdfUserInputHandlerjava package midterm2023 import javautil.pdf
UserInputHandlerjava package midterm2023 import javautil.pdfadityknits
 
used below format to complete Write your code in the incompl.pdf
used below format to complete Write your code in the incompl.pdfused below format to complete Write your code in the incompl.pdf
used below format to complete Write your code in the incompl.pdfadityknits
 
Use to answer the following questions Match the letters wit.pdf
Use to answer the following questions Match the letters wit.pdfUse to answer the following questions Match the letters wit.pdf
Use to answer the following questions Match the letters wit.pdfadityknits
 
Use this list of terms to complete the sentences that follow.pdf
Use this list of terms to complete the sentences that follow.pdfUse this list of terms to complete the sentences that follow.pdf
Use this list of terms to complete the sentences that follow.pdfadityknits
 
Use the Web to find as many examples as you can of open sour.pdf
Use the Web to find as many examples as you can of open sour.pdfUse the Web to find as many examples as you can of open sour.pdf
Use the Web to find as many examples as you can of open sour.pdfadityknits
 
Use the spreadsheet extract to answer the questions Requir.pdf
Use the spreadsheet extract to answer the questions   Requir.pdfUse the spreadsheet extract to answer the questions   Requir.pdf
Use the spreadsheet extract to answer the questions Requir.pdfadityknits
 
Use the scenario to come up with the metabolic pathways requ.pdf
Use the scenario to come up with the metabolic pathways requ.pdfUse the scenario to come up with the metabolic pathways requ.pdf
Use the scenario to come up with the metabolic pathways requ.pdfadityknits
 
Use the RTL design process to create an alarm system that se.pdf
Use the RTL design process to create an alarm system that se.pdfUse the RTL design process to create an alarm system that se.pdf
Use the RTL design process to create an alarm system that se.pdfadityknits
 
Use the micrograph of the Gram stain to draw conclusions and.pdf
Use the micrograph of the Gram stain to draw conclusions and.pdfUse the micrograph of the Gram stain to draw conclusions and.pdf
Use the micrograph of the Gram stain to draw conclusions and.pdfadityknits
 
Use the following code for the tasks public class Animal .pdf
Use the following code for the tasks  public class Animal .pdfUse the following code for the tasks  public class Animal .pdf
Use the following code for the tasks public class Animal .pdfadityknits
 
Use the Internet to identify and compare three different mob.pdf
Use the Internet to identify and compare three different mob.pdfUse the Internet to identify and compare three different mob.pdf
Use the Internet to identify and compare three different mob.pdfadityknits
 
Use the graph below to answer questions 1012 10 Highlight .pdf
Use the graph below to answer questions 1012 10 Highlight .pdfUse the graph below to answer questions 1012 10 Highlight .pdf
Use the graph below to answer questions 1012 10 Highlight .pdfadityknits
 
Use the grey point star symbol to indicate the competitive.pdf
Use the grey point star symbol to indicate the competitive.pdfUse the grey point star symbol to indicate the competitive.pdf
Use the grey point star symbol to indicate the competitive.pdfadityknits
 
Use the following information for the Exercises below The .pdf
Use the following information for the Exercises below The .pdfUse the following information for the Exercises below The .pdf
Use the following information for the Exercises below The .pdfadityknits
 
Use the images from the wild type cell shown below to answer.pdf
Use the images from the wild type cell shown below to answer.pdfUse the images from the wild type cell shown below to answer.pdf
Use the images from the wild type cell shown below to answer.pdfadityknits
 
Use the given information to find the indicated probability.pdf
Use the given information to find the indicated probability.pdfUse the given information to find the indicated probability.pdf
Use the given information to find the indicated probability.pdfadityknits
 
Use the following scenario to respond to items 10 and 11 T.pdf
Use the following scenario to respond to items 10 and 11  T.pdfUse the following scenario to respond to items 10 and 11  T.pdf
Use the following scenario to respond to items 10 and 11 T.pdfadityknits
 
Use the following provided information Pessimistic Scenari.pdf
Use the following provided information Pessimistic Scenari.pdfUse the following provided information Pessimistic Scenari.pdf
Use the following provided information Pessimistic Scenari.pdfadityknits
 
Use the following data to create a bar graph Part 3 Use the.pdf
Use the following data to create a bar graph Part 3 Use the.pdfUse the following data to create a bar graph Part 3 Use the.pdf
Use the following data to create a bar graph Part 3 Use the.pdfadityknits
 

Más de adityknits (20)

Using a company that you know or fictitious company briefly .pdf
Using a company that you know or fictitious company briefly .pdfUsing a company that you know or fictitious company briefly .pdf
Using a company that you know or fictitious company briefly .pdf
 
UserInputHandlerjava package midterm2023 import javautil.pdf
UserInputHandlerjava package midterm2023 import javautil.pdfUserInputHandlerjava package midterm2023 import javautil.pdf
UserInputHandlerjava package midterm2023 import javautil.pdf
 
used below format to complete Write your code in the incompl.pdf
used below format to complete Write your code in the incompl.pdfused below format to complete Write your code in the incompl.pdf
used below format to complete Write your code in the incompl.pdf
 
Use to answer the following questions Match the letters wit.pdf
Use to answer the following questions Match the letters wit.pdfUse to answer the following questions Match the letters wit.pdf
Use to answer the following questions Match the letters wit.pdf
 
Use this list of terms to complete the sentences that follow.pdf
Use this list of terms to complete the sentences that follow.pdfUse this list of terms to complete the sentences that follow.pdf
Use this list of terms to complete the sentences that follow.pdf
 
Use the Web to find as many examples as you can of open sour.pdf
Use the Web to find as many examples as you can of open sour.pdfUse the Web to find as many examples as you can of open sour.pdf
Use the Web to find as many examples as you can of open sour.pdf
 
Use the spreadsheet extract to answer the questions Requir.pdf
Use the spreadsheet extract to answer the questions   Requir.pdfUse the spreadsheet extract to answer the questions   Requir.pdf
Use the spreadsheet extract to answer the questions Requir.pdf
 
Use the scenario to come up with the metabolic pathways requ.pdf
Use the scenario to come up with the metabolic pathways requ.pdfUse the scenario to come up with the metabolic pathways requ.pdf
Use the scenario to come up with the metabolic pathways requ.pdf
 
Use the RTL design process to create an alarm system that se.pdf
Use the RTL design process to create an alarm system that se.pdfUse the RTL design process to create an alarm system that se.pdf
Use the RTL design process to create an alarm system that se.pdf
 
Use the micrograph of the Gram stain to draw conclusions and.pdf
Use the micrograph of the Gram stain to draw conclusions and.pdfUse the micrograph of the Gram stain to draw conclusions and.pdf
Use the micrograph of the Gram stain to draw conclusions and.pdf
 
Use the following code for the tasks public class Animal .pdf
Use the following code for the tasks  public class Animal .pdfUse the following code for the tasks  public class Animal .pdf
Use the following code for the tasks public class Animal .pdf
 
Use the Internet to identify and compare three different mob.pdf
Use the Internet to identify and compare three different mob.pdfUse the Internet to identify and compare three different mob.pdf
Use the Internet to identify and compare three different mob.pdf
 
Use the graph below to answer questions 1012 10 Highlight .pdf
Use the graph below to answer questions 1012 10 Highlight .pdfUse the graph below to answer questions 1012 10 Highlight .pdf
Use the graph below to answer questions 1012 10 Highlight .pdf
 
Use the grey point star symbol to indicate the competitive.pdf
Use the grey point star symbol to indicate the competitive.pdfUse the grey point star symbol to indicate the competitive.pdf
Use the grey point star symbol to indicate the competitive.pdf
 
Use the following information for the Exercises below The .pdf
Use the following information for the Exercises below The .pdfUse the following information for the Exercises below The .pdf
Use the following information for the Exercises below The .pdf
 
Use the images from the wild type cell shown below to answer.pdf
Use the images from the wild type cell shown below to answer.pdfUse the images from the wild type cell shown below to answer.pdf
Use the images from the wild type cell shown below to answer.pdf
 
Use the given information to find the indicated probability.pdf
Use the given information to find the indicated probability.pdfUse the given information to find the indicated probability.pdf
Use the given information to find the indicated probability.pdf
 
Use the following scenario to respond to items 10 and 11 T.pdf
Use the following scenario to respond to items 10 and 11  T.pdfUse the following scenario to respond to items 10 and 11  T.pdf
Use the following scenario to respond to items 10 and 11 T.pdf
 
Use the following provided information Pessimistic Scenari.pdf
Use the following provided information Pessimistic Scenari.pdfUse the following provided information Pessimistic Scenari.pdf
Use the following provided information Pessimistic Scenari.pdf
 
Use the following data to create a bar graph Part 3 Use the.pdf
Use the following data to create a bar graph Part 3 Use the.pdfUse the following data to create a bar graph Part 3 Use the.pdf
Use the following data to create a bar graph Part 3 Use the.pdf
 

Último

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 

Último (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 

use recursion to convert prefix expressions directly to post.pdf

  • 1. use recursion to convert prefix expressions directly to postfix expressions. You may not use a stack as you did in Lab 1. Write a Java program that accepts a prefix expression containing single letter operands and the operators +, -, *, /, and $ (representing exponentiation). Output the corresponding postfix expression. For example, if your input is *AB then output should be AB*. Output of BA* is considered incorrect. In your analysis, be sure to discuss why recursion makes sense. Consider your recursive solution with your iterative solution from Lab 1. Is one better than the other? DO you feel differntly than you didi when you wrote Lab 1. Tell us what you learned and what you would do differently. Be sure to review the Programming Assignment Guidelines for specific requirements for the Analysis and before submitting this assignment. Input File: *AB -+ABC -A+BC $+-ABC+D-EF -*A$B+C-DE*EF **A+BC+C-BA /A+BC +C*BA *-*-ABC+BA /+/A-BC-BA *$A+BC+C-BA //A+B0-C+BA *$A^BC+C-BA