Question: In data structure java (stack) , please solve this task, i need (( code & run sample)) . Paragraph Styles 043 Tasks/Assignments(s) 1- Missing Brackets

In data structure java (stack) , please solve this task, i need (( code & run sample)) In data structure java (stack) , please solve this task, i need(( code & run sample)) . Paragraph Styles 043 Tasks/Assignments(s) 1- Missing.

Paragraph Styles 043 Tasks/Assignments(s) 1- Missing Brackets Checking: Write a method to find if an expression has missing brackets or not using StackLinkedList. The method takes a String expression as a parameter and return True if the expression's brackets are correct and False otherwise. If you see a (, [, or {, push it on the stack If you see a), ), or }, pop the stack and check whether you got the corresponding ( [, or { When you reach the end, check that the stack is empty If (stack is empty) Then Correct & Balance Else Incorrect & Unbalance [End If] Sample outputs: utput - StackApp (run) X run: Please enter an expression with parentheses: [(a+b)]{a-p} Your expression is correct and balanced itput - StackApp (run) X BUILD SUCCESSFUL (total time: 13 seconds) run: Please enter an expression with parentheses: [(a+b] {a-p} Your expression is not correct. Unbalanced parentheses BUILD SUCCESSFUL (total time: 4 seconds) 2- Converting Decimal to Binary: Write your own Stack program to implement the following problem. Consider the following pseudocode to convert Decimal to Binary: Read (number) Loop (number > 0) 1) digit = number modulo 2 2) print (digit) 3) number = number/2 The problem with this code is that it will print the binary number backwards. (ex: 19 becomes 11001000 instead of 00010011) To remedy this problem, instead of printing the digit right away, we can push it onto the stack. Then after the number is done being converted, we pop the digit out of the stack and print it. Deliverables(s)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!