SlideShare a Scribd company logo
1 of 2
Download to read offline
Please change this method to recursive method.
public String postfix() {
final ExpressionNodes nodes = new ExpressionNodes();
for (String element : expression.split(" ")) {
if (isOperator(element)) {
String rightNode = nodes.pop();
String leftNode = nodes.pop();
nodes.push((leftNode + " " + rightNode + " " + element));
} else {
nodes.push((element));
}
}
return nodes.pop();
}
Solution
public class Main{
public String postfix(int count)
final ExpressiononNodes nodes = new ExpressiononNodes ();
for( String element : expression split(" "))
{
if (Is Operator(int element))
{
String rightNode = nodes.pop();
String leftNode = nodes.pop();
nodes.push((leftNode + " " + rightNode + " " +element));
}
else
{
nodes.push ((element));
}}
if (count <=0)
{
return nodes.pop();
}
else
{
postfix(count - 1);
}}
Public static void Main(String[] args)
{
Main n = new Main();
n.postfix(element);
}

More Related Content

Similar to Please change this method to recursive method.  public String post.pdf

I want help in the following C++ programming task. Please do coding .pdf
I want help in the following C++ programming task. Please do coding .pdfI want help in the following C++ programming task. Please do coding .pdf
I want help in the following C++ programming task. Please do coding .pdfbermanbeancolungak45
 
I keep getting NullPointerExcepetion, can someone help me with spinL.pdf
I keep getting NullPointerExcepetion, can someone help me with spinL.pdfI keep getting NullPointerExcepetion, can someone help me with spinL.pdf
I keep getting NullPointerExcepetion, can someone help me with spinL.pdfarkmuzikllc
 
fix the error - class Node{ int data- Node next-.pdf
fix the error -   class Node{           int data-           Node next-.pdffix the error -   class Node{           int data-           Node next-.pdf
fix the error - class Node{ int data- Node next-.pdfAKVIGFOEU
 
Java code to find the closest pair using divide and conquer algorith.pdf
Java code to find the closest pair using divide and conquer algorith.pdfJava code to find the closest pair using divide and conquer algorith.pdf
Java code to find the closest pair using divide and conquer algorith.pdffashioncollection2
 
Functional programming ii
Functional programming iiFunctional programming ii
Functional programming iiPrashant Kalkar
 
Create a new java class called ListNode. Implement ListNode as a gen.pdf
Create a new java class called ListNode. Implement ListNode as a gen.pdfCreate a new java class called ListNode. Implement ListNode as a gen.pdf
Create a new java class called ListNode. Implement ListNode as a gen.pdfmohamednihalshahru
 
You can list anything, it doesnt matter. I just want to see code f.pdf
You can list anything, it doesnt matter. I just want to see code f.pdfYou can list anything, it doesnt matter. I just want to see code f.pdf
You can list anything, it doesnt matter. I just want to see code f.pdffashionbigchennai
 
I need help finishing this code in JavaYou will need to create t.pdf
I need help finishing this code in JavaYou will need to create t.pdfI need help finishing this code in JavaYou will need to create t.pdf
I need help finishing this code in JavaYou will need to create t.pdfallurafashions98
 
hi i have to write a java program involving link lists. i have a pro.pdf
hi i have to write a java program involving link lists. i have a pro.pdfhi i have to write a java program involving link lists. i have a pro.pdf
hi i have to write a java program involving link lists. i have a pro.pdfarchgeetsenterprises
 
package edu-ser222-m03_02- --- - A binary search tree based impleme.docx
package edu-ser222-m03_02-   ---  - A binary search tree based impleme.docxpackage edu-ser222-m03_02-   ---  - A binary search tree based impleme.docx
package edu-ser222-m03_02- --- - A binary search tree based impleme.docxfarrahkur54
 
Write a JAVA LinkedListRec class that has the following methods siz.pdf
Write a JAVA LinkedListRec class that has the following methods siz.pdfWrite a JAVA LinkedListRec class that has the following methods siz.pdf
Write a JAVA LinkedListRec class that has the following methods siz.pdfinfo785431
 
In the class we extensively discussed a generic singly linked list i.pdf
In the class we extensively discussed a generic singly linked list i.pdfIn the class we extensively discussed a generic singly linked list i.pdf
In the class we extensively discussed a generic singly linked list i.pdfbirajdar2
 
Note             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdfNote             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdfAnkitchhabra28
 
in C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdfin C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdfeyewaregallery
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Codemotion
 
GIVEN CODE template -typename T- class DList { private- struct Node {.docx
GIVEN CODE template -typename T- class DList { private- struct Node {.docxGIVEN CODE template -typename T- class DList { private- struct Node {.docx
GIVEN CODE template -typename T- class DList { private- struct Node {.docxLeonardN9WWelchw
 
I need help writing test Codepackage org.example;import j.pdf
I need help writing test Codepackage org.example;import j.pdfI need help writing test Codepackage org.example;import j.pdf
I need help writing test Codepackage org.example;import j.pdfmail931892
 
The LinkedList1 class implements a Linked list. class.pdf
The LinkedList1 class implements a Linked list. class.pdfThe LinkedList1 class implements a Linked list. class.pdf
The LinkedList1 class implements a Linked list. class.pdfmalavshah9013
 
Sorted number list implementation with linked listsStep 1 Inspec.pdf
 Sorted number list implementation with linked listsStep 1 Inspec.pdf Sorted number list implementation with linked listsStep 1 Inspec.pdf
Sorted number list implementation with linked listsStep 1 Inspec.pdfalmaniaeyewear
 

Similar to Please change this method to recursive method.  public String post.pdf (20)

I want help in the following C++ programming task. Please do coding .pdf
I want help in the following C++ programming task. Please do coding .pdfI want help in the following C++ programming task. Please do coding .pdf
I want help in the following C++ programming task. Please do coding .pdf
 
I keep getting NullPointerExcepetion, can someone help me with spinL.pdf
I keep getting NullPointerExcepetion, can someone help me with spinL.pdfI keep getting NullPointerExcepetion, can someone help me with spinL.pdf
I keep getting NullPointerExcepetion, can someone help me with spinL.pdf
 
fix the error - class Node{ int data- Node next-.pdf
fix the error -   class Node{           int data-           Node next-.pdffix the error -   class Node{           int data-           Node next-.pdf
fix the error - class Node{ int data- Node next-.pdf
 
Java code to find the closest pair using divide and conquer algorith.pdf
Java code to find the closest pair using divide and conquer algorith.pdfJava code to find the closest pair using divide and conquer algorith.pdf
Java code to find the closest pair using divide and conquer algorith.pdf
 
Functional programming ii
Functional programming iiFunctional programming ii
Functional programming ii
 
Create a new java class called ListNode. Implement ListNode as a gen.pdf
Create a new java class called ListNode. Implement ListNode as a gen.pdfCreate a new java class called ListNode. Implement ListNode as a gen.pdf
Create a new java class called ListNode. Implement ListNode as a gen.pdf
 
You can list anything, it doesnt matter. I just want to see code f.pdf
You can list anything, it doesnt matter. I just want to see code f.pdfYou can list anything, it doesnt matter. I just want to see code f.pdf
You can list anything, it doesnt matter. I just want to see code f.pdf
 
I need help finishing this code in JavaYou will need to create t.pdf
I need help finishing this code in JavaYou will need to create t.pdfI need help finishing this code in JavaYou will need to create t.pdf
I need help finishing this code in JavaYou will need to create t.pdf
 
hi i have to write a java program involving link lists. i have a pro.pdf
hi i have to write a java program involving link lists. i have a pro.pdfhi i have to write a java program involving link lists. i have a pro.pdf
hi i have to write a java program involving link lists. i have a pro.pdf
 
package edu-ser222-m03_02- --- - A binary search tree based impleme.docx
package edu-ser222-m03_02-   ---  - A binary search tree based impleme.docxpackage edu-ser222-m03_02-   ---  - A binary search tree based impleme.docx
package edu-ser222-m03_02- --- - A binary search tree based impleme.docx
 
Write a JAVA LinkedListRec class that has the following methods siz.pdf
Write a JAVA LinkedListRec class that has the following methods siz.pdfWrite a JAVA LinkedListRec class that has the following methods siz.pdf
Write a JAVA LinkedListRec class that has the following methods siz.pdf
 
In the class we extensively discussed a generic singly linked list i.pdf
In the class we extensively discussed a generic singly linked list i.pdfIn the class we extensively discussed a generic singly linked list i.pdf
In the class we extensively discussed a generic singly linked list i.pdf
 
Note             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdfNote             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdf
 
in C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdfin C++ , Design a linked list class named IntegerList to hold a seri.pdf
in C++ , Design a linked list class named IntegerList to hold a seri.pdf
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...
 
GIVEN CODE template -typename T- class DList { private- struct Node {.docx
GIVEN CODE template -typename T- class DList { private- struct Node {.docxGIVEN CODE template -typename T- class DList { private- struct Node {.docx
GIVEN CODE template -typename T- class DList { private- struct Node {.docx
 
Jeop game-final-review
Jeop game-final-reviewJeop game-final-review
Jeop game-final-review
 
I need help writing test Codepackage org.example;import j.pdf
I need help writing test Codepackage org.example;import j.pdfI need help writing test Codepackage org.example;import j.pdf
I need help writing test Codepackage org.example;import j.pdf
 
The LinkedList1 class implements a Linked list. class.pdf
The LinkedList1 class implements a Linked list. class.pdfThe LinkedList1 class implements a Linked list. class.pdf
The LinkedList1 class implements a Linked list. class.pdf
 
Sorted number list implementation with linked listsStep 1 Inspec.pdf
 Sorted number list implementation with linked listsStep 1 Inspec.pdf Sorted number list implementation with linked listsStep 1 Inspec.pdf
Sorted number list implementation with linked listsStep 1 Inspec.pdf
 

More from pallavi953613

You dilute a stock solution containing 2.5 x 107 cells ml by a fact.pdf
You dilute a stock solution containing 2.5 x 107 cells ml by a fact.pdfYou dilute a stock solution containing 2.5 x 107 cells ml by a fact.pdf
You dilute a stock solution containing 2.5 x 107 cells ml by a fact.pdfpallavi953613
 
Which of the following are fuzzy sets Highly creative people F(x) .pdf
Which of the following are fuzzy sets  Highly creative people  F(x) .pdfWhich of the following are fuzzy sets  Highly creative people  F(x) .pdf
Which of the following are fuzzy sets Highly creative people F(x) .pdfpallavi953613
 
When, if ever, is it legitimate to rebel against government authorit.pdf
When, if ever, is it legitimate to rebel against government authorit.pdfWhen, if ever, is it legitimate to rebel against government authorit.pdf
When, if ever, is it legitimate to rebel against government authorit.pdfpallavi953613
 
When can we use the paired t-testA. When we want the most powerfu.pdf
When can we use the paired t-testA. When we want the most powerfu.pdfWhen can we use the paired t-testA. When we want the most powerfu.pdf
When can we use the paired t-testA. When we want the most powerfu.pdfpallavi953613
 
what is the purpose of the 4 quadrant streak plateSolutionAnsw.pdf
what is the purpose of the 4 quadrant streak plateSolutionAnsw.pdfwhat is the purpose of the 4 quadrant streak plateSolutionAnsw.pdf
what is the purpose of the 4 quadrant streak plateSolutionAnsw.pdfpallavi953613
 
what is the co factor of restriction endonulease EcoRV that activiat.pdf
what is the co factor of restriction endonulease EcoRV that activiat.pdfwhat is the co factor of restriction endonulease EcoRV that activiat.pdf
what is the co factor of restriction endonulease EcoRV that activiat.pdfpallavi953613
 
This graph is data collected from a species of water snake. Because .pdf
This graph is data collected from a species of water snake. Because .pdfThis graph is data collected from a species of water snake. Because .pdf
This graph is data collected from a species of water snake. Because .pdfpallavi953613
 
The voltage applied to our salinity sensor probes from Week 11 cause.pdf
The voltage applied to our salinity sensor probes from Week 11 cause.pdfThe voltage applied to our salinity sensor probes from Week 11 cause.pdf
The voltage applied to our salinity sensor probes from Week 11 cause.pdfpallavi953613
 
The following contingency table shows opinion about global warming (n.pdf
The following contingency table shows opinion about global warming (n.pdfThe following contingency table shows opinion about global warming (n.pdf
The following contingency table shows opinion about global warming (n.pdfpallavi953613
 
The children at a certain school were asked what they prefer to drink.pdf
The children at a certain school were asked what they prefer to drink.pdfThe children at a certain school were asked what they prefer to drink.pdf
The children at a certain school were asked what they prefer to drink.pdfpallavi953613
 
Talk about comparative fitness of poikilotherms vs homeothermsSo.pdf
Talk about comparative fitness of poikilotherms vs homeothermsSo.pdfTalk about comparative fitness of poikilotherms vs homeothermsSo.pdf
Talk about comparative fitness of poikilotherms vs homeothermsSo.pdfpallavi953613
 
STERN m cr TORSO Tall mayil Long an Ribs Pamella fibula Qwalang eRVIc.pdf
STERN m cr TORSO Tall mayil Long an Ribs Pamella fibula Qwalang eRVIc.pdfSTERN m cr TORSO Tall mayil Long an Ribs Pamella fibula Qwalang eRVIc.pdf
STERN m cr TORSO Tall mayil Long an Ribs Pamella fibula Qwalang eRVIc.pdfpallavi953613
 
Project Management GB544What are some of the challenges in requi.pdf
Project Management GB544What are some of the challenges in requi.pdfProject Management GB544What are some of the challenges in requi.pdf
Project Management GB544What are some of the challenges in requi.pdfpallavi953613
 
Match the epithelial tissue with its appropriate name. Simple cu.pdf
Match the epithelial tissue with its appropriate name.  Simple cu.pdfMatch the epithelial tissue with its appropriate name.  Simple cu.pdf
Match the epithelial tissue with its appropriate name. Simple cu.pdfpallavi953613
 
Please read below case and individually take the role of “NGOsAdvoc.pdf
Please read below case and individually take the role of “NGOsAdvoc.pdfPlease read below case and individually take the role of “NGOsAdvoc.pdf
Please read below case and individually take the role of “NGOsAdvoc.pdfpallavi953613
 
Paul started a business with the following characteristics All sh.pdf
Paul started a business with the following characteristics All sh.pdfPaul started a business with the following characteristics All sh.pdf
Paul started a business with the following characteristics All sh.pdfpallavi953613
 
Name 2 organs andor glands, not membranes, which are found within (n.pdf
Name 2 organs andor glands, not membranes, which are found within (n.pdfName 2 organs andor glands, not membranes, which are found within (n.pdf
Name 2 organs andor glands, not membranes, which are found within (n.pdfpallavi953613
 
Mitochondria contain their own genome, are able to duplicate, and act.pdf
Mitochondria contain their own genome, are able to duplicate, and act.pdfMitochondria contain their own genome, are able to duplicate, and act.pdf
Mitochondria contain their own genome, are able to duplicate, and act.pdfpallavi953613
 
Match the term in column 1 to the definition in column 2.A.Atoll A.pdf
Match the term in column 1 to the definition in column 2.A.Atoll A.pdfMatch the term in column 1 to the definition in column 2.A.Atoll A.pdf
Match the term in column 1 to the definition in column 2.A.Atoll A.pdfpallavi953613
 
In the United States, governmental authority rests on an agreement a.pdf
In the United States, governmental authority rests on an agreement a.pdfIn the United States, governmental authority rests on an agreement a.pdf
In the United States, governmental authority rests on an agreement a.pdfpallavi953613
 

More from pallavi953613 (20)

You dilute a stock solution containing 2.5 x 107 cells ml by a fact.pdf
You dilute a stock solution containing 2.5 x 107 cells ml by a fact.pdfYou dilute a stock solution containing 2.5 x 107 cells ml by a fact.pdf
You dilute a stock solution containing 2.5 x 107 cells ml by a fact.pdf
 
Which of the following are fuzzy sets Highly creative people F(x) .pdf
Which of the following are fuzzy sets  Highly creative people  F(x) .pdfWhich of the following are fuzzy sets  Highly creative people  F(x) .pdf
Which of the following are fuzzy sets Highly creative people F(x) .pdf
 
When, if ever, is it legitimate to rebel against government authorit.pdf
When, if ever, is it legitimate to rebel against government authorit.pdfWhen, if ever, is it legitimate to rebel against government authorit.pdf
When, if ever, is it legitimate to rebel against government authorit.pdf
 
When can we use the paired t-testA. When we want the most powerfu.pdf
When can we use the paired t-testA. When we want the most powerfu.pdfWhen can we use the paired t-testA. When we want the most powerfu.pdf
When can we use the paired t-testA. When we want the most powerfu.pdf
 
what is the purpose of the 4 quadrant streak plateSolutionAnsw.pdf
what is the purpose of the 4 quadrant streak plateSolutionAnsw.pdfwhat is the purpose of the 4 quadrant streak plateSolutionAnsw.pdf
what is the purpose of the 4 quadrant streak plateSolutionAnsw.pdf
 
what is the co factor of restriction endonulease EcoRV that activiat.pdf
what is the co factor of restriction endonulease EcoRV that activiat.pdfwhat is the co factor of restriction endonulease EcoRV that activiat.pdf
what is the co factor of restriction endonulease EcoRV that activiat.pdf
 
This graph is data collected from a species of water snake. Because .pdf
This graph is data collected from a species of water snake. Because .pdfThis graph is data collected from a species of water snake. Because .pdf
This graph is data collected from a species of water snake. Because .pdf
 
The voltage applied to our salinity sensor probes from Week 11 cause.pdf
The voltage applied to our salinity sensor probes from Week 11 cause.pdfThe voltage applied to our salinity sensor probes from Week 11 cause.pdf
The voltage applied to our salinity sensor probes from Week 11 cause.pdf
 
The following contingency table shows opinion about global warming (n.pdf
The following contingency table shows opinion about global warming (n.pdfThe following contingency table shows opinion about global warming (n.pdf
The following contingency table shows opinion about global warming (n.pdf
 
The children at a certain school were asked what they prefer to drink.pdf
The children at a certain school were asked what they prefer to drink.pdfThe children at a certain school were asked what they prefer to drink.pdf
The children at a certain school were asked what they prefer to drink.pdf
 
Talk about comparative fitness of poikilotherms vs homeothermsSo.pdf
Talk about comparative fitness of poikilotherms vs homeothermsSo.pdfTalk about comparative fitness of poikilotherms vs homeothermsSo.pdf
Talk about comparative fitness of poikilotherms vs homeothermsSo.pdf
 
STERN m cr TORSO Tall mayil Long an Ribs Pamella fibula Qwalang eRVIc.pdf
STERN m cr TORSO Tall mayil Long an Ribs Pamella fibula Qwalang eRVIc.pdfSTERN m cr TORSO Tall mayil Long an Ribs Pamella fibula Qwalang eRVIc.pdf
STERN m cr TORSO Tall mayil Long an Ribs Pamella fibula Qwalang eRVIc.pdf
 
Project Management GB544What are some of the challenges in requi.pdf
Project Management GB544What are some of the challenges in requi.pdfProject Management GB544What are some of the challenges in requi.pdf
Project Management GB544What are some of the challenges in requi.pdf
 
Match the epithelial tissue with its appropriate name. Simple cu.pdf
Match the epithelial tissue with its appropriate name.  Simple cu.pdfMatch the epithelial tissue with its appropriate name.  Simple cu.pdf
Match the epithelial tissue with its appropriate name. Simple cu.pdf
 
Please read below case and individually take the role of “NGOsAdvoc.pdf
Please read below case and individually take the role of “NGOsAdvoc.pdfPlease read below case and individually take the role of “NGOsAdvoc.pdf
Please read below case and individually take the role of “NGOsAdvoc.pdf
 
Paul started a business with the following characteristics All sh.pdf
Paul started a business with the following characteristics All sh.pdfPaul started a business with the following characteristics All sh.pdf
Paul started a business with the following characteristics All sh.pdf
 
Name 2 organs andor glands, not membranes, which are found within (n.pdf
Name 2 organs andor glands, not membranes, which are found within (n.pdfName 2 organs andor glands, not membranes, which are found within (n.pdf
Name 2 organs andor glands, not membranes, which are found within (n.pdf
 
Mitochondria contain their own genome, are able to duplicate, and act.pdf
Mitochondria contain their own genome, are able to duplicate, and act.pdfMitochondria contain their own genome, are able to duplicate, and act.pdf
Mitochondria contain their own genome, are able to duplicate, and act.pdf
 
Match the term in column 1 to the definition in column 2.A.Atoll A.pdf
Match the term in column 1 to the definition in column 2.A.Atoll A.pdfMatch the term in column 1 to the definition in column 2.A.Atoll A.pdf
Match the term in column 1 to the definition in column 2.A.Atoll A.pdf
 
In the United States, governmental authority rests on an agreement a.pdf
In the United States, governmental authority rests on an agreement a.pdfIn the United States, governmental authority rests on an agreement a.pdf
In the United States, governmental authority rests on an agreement a.pdf
 

Recently uploaded

PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
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).pptxneillewis46
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
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...EduSkills OECD
 
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...Gary Wood
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
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 Partnershipsexpandedwebsite
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 

Recently uploaded (20)

PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
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
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.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...
 
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...
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
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)
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
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
 
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"
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 

Please change this method to recursive method.  public String post.pdf

  • 1. Please change this method to recursive method. public String postfix() { final ExpressionNodes nodes = new ExpressionNodes(); for (String element : expression.split(" ")) { if (isOperator(element)) { String rightNode = nodes.pop(); String leftNode = nodes.pop(); nodes.push((leftNode + " " + rightNode + " " + element)); } else { nodes.push((element)); } } return nodes.pop(); } Solution public class Main{ public String postfix(int count) final ExpressiononNodes nodes = new ExpressiononNodes (); for( String element : expression split(" ")) { if (Is Operator(int element)) { String rightNode = nodes.pop(); String leftNode = nodes.pop(); nodes.push((leftNode + " " + rightNode + " " +element)); } else { nodes.push ((element)); }} if (count <=0) { return nodes.pop();
  • 2. } else { postfix(count - 1); }} Public static void Main(String[] args) { Main n = new Main(); n.postfix(element); }