SlideShare ist ein Scribd-Unternehmen logo
1 von 1
When considering the push() and pop() operations for a stack, how could a compiler program use
a stack to implement delimiter matching. For example, matching delimiter strings could be:
“{”, “}”, “(”, “)”, and “/*”, and “*/”.
Solution
private static final char[] opening = new char[]{'(', '[', '{'};
private static final char[] closing = new char[]{')', ']', '}'};
and stack integer can be denoted so that if the value is -1 then there is an error else matched.
How stack is used in delimiter matching:
6) if the stack is not empty finally at the end then report missing right delimiter error

Weitere ähnliche Inhalte

Mehr von todd571

When equal moles of the following acids are dissolved in 1 L of H2O- w.docx
When equal moles of the following acids are dissolved in 1 L of H2O- w.docxWhen equal moles of the following acids are dissolved in 1 L of H2O- w.docx
When equal moles of the following acids are dissolved in 1 L of H2O- w.docxtodd571
 
When an organization starts to plan for business continuity and disast.docx
When an organization starts to plan for business continuity and disast.docxWhen an organization starts to plan for business continuity and disast.docx
When an organization starts to plan for business continuity and disast.docxtodd571
 
When discussing the security of SSO systems- which of the following is (2).docx
When discussing the security of SSO systems- which of the following is (2).docxWhen discussing the security of SSO systems- which of the following is (2).docx
When discussing the security of SSO systems- which of the following is (2).docxtodd571
 
When discussing the security of SSO systems- which of the following is (1).docx
When discussing the security of SSO systems- which of the following is (1).docxWhen discussing the security of SSO systems- which of the following is (1).docx
When discussing the security of SSO systems- which of the following is (1).docxtodd571
 
When an electron emits light energy and drops from the fourth to the t.docx
When an electron emits light energy and drops from the fourth to the t.docxWhen an electron emits light energy and drops from the fourth to the t.docx
When an electron emits light energy and drops from the fourth to the t.docxtodd571
 
When a liquid is placed in a sealed container- A) a set vapor pressure.docx
When a liquid is placed in a sealed container- A) a set vapor pressure.docxWhen a liquid is placed in a sealed container- A) a set vapor pressure.docx
When a liquid is placed in a sealed container- A) a set vapor pressure.docxtodd571
 
When a hydrate compound is heated- does the water get broken down into.docx
When a hydrate compound is heated- does the water get broken down into.docxWhen a hydrate compound is heated- does the water get broken down into.docx
When a hydrate compound is heated- does the water get broken down into.docxtodd571
 
What will happen to the Ksp value of Al(OH)3 when sodium hydroxide is.docx
What will happen to the Ksp value of Al(OH)3 when sodium hydroxide is.docxWhat will happen to the Ksp value of Al(OH)3 when sodium hydroxide is.docx
What will happen to the Ksp value of Al(OH)3 when sodium hydroxide is.docxtodd571
 
Which of the following can be used to create a VPN (Virtual Private Ne.docx
Which of the following can be used to create a VPN (Virtual Private Ne.docxWhich of the following can be used to create a VPN (Virtual Private Ne.docx
Which of the following can be used to create a VPN (Virtual Private Ne.docxtodd571
 
Which of the following are sources of lags in monetary policy- I- Con.docx
Which of the following are sources of lags in monetary policy-  I- Con.docxWhich of the following are sources of lags in monetary policy-  I- Con.docx
Which of the following are sources of lags in monetary policy- I- Con.docxtodd571
 
Which of the following are significant shortcomings with voluntary CSR.docx
Which of the following are significant shortcomings with voluntary CSR.docxWhich of the following are significant shortcomings with voluntary CSR.docx
Which of the following are significant shortcomings with voluntary CSR.docxtodd571
 
What various activities can be performed using IIS Manager-SolutionIIS.docx
What various activities can be performed using IIS Manager-SolutionIIS.docxWhat various activities can be performed using IIS Manager-SolutionIIS.docx
What various activities can be performed using IIS Manager-SolutionIIS.docxtodd571
 
What type(s) of bonding would be expected for each of the following ma.docx
What type(s) of bonding would be expected for each of the following ma.docxWhat type(s) of bonding would be expected for each of the following ma.docx
What type(s) of bonding would be expected for each of the following ma.docxtodd571
 
Which of the following are features of Btrfs- relocating files and sub.docx
Which of the following are features of Btrfs- relocating files and sub.docxWhich of the following are features of Btrfs- relocating files and sub.docx
Which of the following are features of Btrfs- relocating files and sub.docxtodd571
 
Which of the following accounting principles requires businesses to re.docx
Which of the following accounting principles requires businesses to re.docxWhich of the following accounting principles requires businesses to re.docx
Which of the following accounting principles requires businesses to re.docxtodd571
 
Which method would answer this question- To investigate if the use of.docx
Which method would answer this question- To investigate if the use of.docxWhich method would answer this question- To investigate if the use of.docx
Which method would answer this question- To investigate if the use of.docxtodd571
 
What type of intermolecular forces exist in NH3 and H2S- dispersion fo.docx
What type of intermolecular forces exist in NH3 and H2S- dispersion fo.docxWhat type of intermolecular forces exist in NH3 and H2S- dispersion fo.docx
What type of intermolecular forces exist in NH3 and H2S- dispersion fo.docxtodd571
 
Which method of evaluating capital investment proposals uses the conce.docx
Which method of evaluating capital investment proposals uses the conce.docxWhich method of evaluating capital investment proposals uses the conce.docx
Which method of evaluating capital investment proposals uses the conce.docxtodd571
 
Which molecule(s) will experience the London force- Select all that ap.docx
Which molecule(s) will experience the London force- Select all that ap.docxWhich molecule(s) will experience the London force- Select all that ap.docx
Which molecule(s) will experience the London force- Select all that ap.docxtodd571
 
Which metal is the stronger reducing agent- copper or zinc- iron or co.docx
Which metal is the stronger reducing agent- copper or zinc- iron or co.docxWhich metal is the stronger reducing agent- copper or zinc- iron or co.docx
Which metal is the stronger reducing agent- copper or zinc- iron or co.docxtodd571
 

Mehr von todd571 (20)

When equal moles of the following acids are dissolved in 1 L of H2O- w.docx
When equal moles of the following acids are dissolved in 1 L of H2O- w.docxWhen equal moles of the following acids are dissolved in 1 L of H2O- w.docx
When equal moles of the following acids are dissolved in 1 L of H2O- w.docx
 
When an organization starts to plan for business continuity and disast.docx
When an organization starts to plan for business continuity and disast.docxWhen an organization starts to plan for business continuity and disast.docx
When an organization starts to plan for business continuity and disast.docx
 
When discussing the security of SSO systems- which of the following is (2).docx
When discussing the security of SSO systems- which of the following is (2).docxWhen discussing the security of SSO systems- which of the following is (2).docx
When discussing the security of SSO systems- which of the following is (2).docx
 
When discussing the security of SSO systems- which of the following is (1).docx
When discussing the security of SSO systems- which of the following is (1).docxWhen discussing the security of SSO systems- which of the following is (1).docx
When discussing the security of SSO systems- which of the following is (1).docx
 
When an electron emits light energy and drops from the fourth to the t.docx
When an electron emits light energy and drops from the fourth to the t.docxWhen an electron emits light energy and drops from the fourth to the t.docx
When an electron emits light energy and drops from the fourth to the t.docx
 
When a liquid is placed in a sealed container- A) a set vapor pressure.docx
When a liquid is placed in a sealed container- A) a set vapor pressure.docxWhen a liquid is placed in a sealed container- A) a set vapor pressure.docx
When a liquid is placed in a sealed container- A) a set vapor pressure.docx
 
When a hydrate compound is heated- does the water get broken down into.docx
When a hydrate compound is heated- does the water get broken down into.docxWhen a hydrate compound is heated- does the water get broken down into.docx
When a hydrate compound is heated- does the water get broken down into.docx
 
What will happen to the Ksp value of Al(OH)3 when sodium hydroxide is.docx
What will happen to the Ksp value of Al(OH)3 when sodium hydroxide is.docxWhat will happen to the Ksp value of Al(OH)3 when sodium hydroxide is.docx
What will happen to the Ksp value of Al(OH)3 when sodium hydroxide is.docx
 
Which of the following can be used to create a VPN (Virtual Private Ne.docx
Which of the following can be used to create a VPN (Virtual Private Ne.docxWhich of the following can be used to create a VPN (Virtual Private Ne.docx
Which of the following can be used to create a VPN (Virtual Private Ne.docx
 
Which of the following are sources of lags in monetary policy- I- Con.docx
Which of the following are sources of lags in monetary policy-  I- Con.docxWhich of the following are sources of lags in monetary policy-  I- Con.docx
Which of the following are sources of lags in monetary policy- I- Con.docx
 
Which of the following are significant shortcomings with voluntary CSR.docx
Which of the following are significant shortcomings with voluntary CSR.docxWhich of the following are significant shortcomings with voluntary CSR.docx
Which of the following are significant shortcomings with voluntary CSR.docx
 
What various activities can be performed using IIS Manager-SolutionIIS.docx
What various activities can be performed using IIS Manager-SolutionIIS.docxWhat various activities can be performed using IIS Manager-SolutionIIS.docx
What various activities can be performed using IIS Manager-SolutionIIS.docx
 
What type(s) of bonding would be expected for each of the following ma.docx
What type(s) of bonding would be expected for each of the following ma.docxWhat type(s) of bonding would be expected for each of the following ma.docx
What type(s) of bonding would be expected for each of the following ma.docx
 
Which of the following are features of Btrfs- relocating files and sub.docx
Which of the following are features of Btrfs- relocating files and sub.docxWhich of the following are features of Btrfs- relocating files and sub.docx
Which of the following are features of Btrfs- relocating files and sub.docx
 
Which of the following accounting principles requires businesses to re.docx
Which of the following accounting principles requires businesses to re.docxWhich of the following accounting principles requires businesses to re.docx
Which of the following accounting principles requires businesses to re.docx
 
Which method would answer this question- To investigate if the use of.docx
Which method would answer this question- To investigate if the use of.docxWhich method would answer this question- To investigate if the use of.docx
Which method would answer this question- To investigate if the use of.docx
 
What type of intermolecular forces exist in NH3 and H2S- dispersion fo.docx
What type of intermolecular forces exist in NH3 and H2S- dispersion fo.docxWhat type of intermolecular forces exist in NH3 and H2S- dispersion fo.docx
What type of intermolecular forces exist in NH3 and H2S- dispersion fo.docx
 
Which method of evaluating capital investment proposals uses the conce.docx
Which method of evaluating capital investment proposals uses the conce.docxWhich method of evaluating capital investment proposals uses the conce.docx
Which method of evaluating capital investment proposals uses the conce.docx
 
Which molecule(s) will experience the London force- Select all that ap.docx
Which molecule(s) will experience the London force- Select all that ap.docxWhich molecule(s) will experience the London force- Select all that ap.docx
Which molecule(s) will experience the London force- Select all that ap.docx
 
Which metal is the stronger reducing agent- copper or zinc- iron or co.docx
Which metal is the stronger reducing agent- copper or zinc- iron or co.docxWhich metal is the stronger reducing agent- copper or zinc- iron or co.docx
Which metal is the stronger reducing agent- copper or zinc- iron or co.docx
 

Kürzlich hochgeladen

General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
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
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 

Kürzlich hochgeladen (20)

General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
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
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 

When considering the push() and pop() operations for a stack- how coul.docx

  • 1. When considering the push() and pop() operations for a stack, how could a compiler program use a stack to implement delimiter matching. For example, matching delimiter strings could be: “{”, “}”, “(”, “)”, and “/*”, and “*/”. Solution private static final char[] opening = new char[]{'(', '[', '{'}; private static final char[] closing = new char[]{')', ']', '}'}; and stack integer can be denoted so that if the value is -1 then there is an error else matched. How stack is used in delimiter matching: 6) if the stack is not empty finally at the end then report missing right delimiter error