# ASSIGNMENT: 2) Obtain a String from user input, and output wheth...

## Question

ASSIGNMENT:

2) Obtain a String from user input, and output whether this string belongs to the language
L = {AnBn, n>=0}. Language L include all the strings of only As and Bs where: all letter Bs appear after letter As, and the number of letter As is the same as the number of letter Bs. Requirement: use stack operations (of link-based stack) to achieve above function.

3) Create and populate a stack that achieves the following two objectives:
a) The links-based implementation of the stack has the following items in sequence:
top -> 1 -> 2 -> 3 -> 4 -> 5
b) Implement a function that takes an ADTStack as a parameter and creates and returns a second stack that is the reverse of the parameter stack. For example, if the parameter stack’s initial state is what is above in part a), then the new stack is:
top -> 5 -> 4 -> 3 -> 2 ->1

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import java.util.Scanner;

class Node{
char value;
Node next;

public Node(char value){
this.value = value;
next = null;
}

public char getValue(){
return value;
}

public Node getNext() {
return next;
}

public void setNext(Node next) {
this.next = next;
}
}

}

public void push(char value){
Node node = new Node(value);
}else {
}
}

public char pop(){
if(!isEmpty()){
return d.getValue();
}else {
return ' ';
}
}...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

# 50% discount

Hours
Minutes
Seconds
\$45.00 \$22.50
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available Data Structures and Algorithms Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.