1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
prisoha [69]
3 years ago
10

Java !!!

Computers and Technology
1 answer:
coldgirl [10]3 years ago
7 0

Answer:

Explanation:

import java.util.*;

public class BalancedBrackets {

// function to check if brackets are balanced

static boolean isBalanced(String expr)

{

Stack<Character> stack = new Stack<Character>();

for (int i = 0; i < expr.length(); i++)

{

char x = expr.charAt(i);

if (x == '(' || x == '[' || x == '{')

{

// Push the element in the stack

stack.push(x);

continue;

}

if (stack.isEmpty())

return false;

char check;

switch (x) {

case ')':

check = stack.pop();

if (check == '{' || check == '[')

return false;

break;

case '}':

check = stack.pop();

if (check == '(' || check == '[')

return false;

break;

case ']':

check = stack.pop();

if (check == '(' || check == '{')

return false;

break;

}

}

// Check Empty Stack

return (stack.isEmpty());

}

public static void main(String[] args)

{

Scanner scan = new Scanner(System.in);

System.out.println("\nEnter the expression to check is balanced or not !");

String expr = scan.nextLine();

boolean output;

output = isBalanced(expr);

System.out.println(output);

if (output)

System.out.println("Balanced ");

else

System.out.println("Not Balanced ");

scan.close();

}

}

You might be interested in
_____ allows information to be viewed at a glance without needing to address the individual elements of the information separate
blagie [28]

Spatial representation allows information to be viewed at a glance without needing to address the individual elements of the information separately or analytically.

<h3>What do you mean information?</h3>
  • Information is a stimulus with meaning for the receiver in a specific situation.
  • Data is a broad term that refers to information that is entered into and stored in a computer.
  • Data that has been processed, such as formatting and printing, can be interpreted as information again.
  • When you communicate verbally, nonverbally, graphically, or in writing, you are passing on knowledge gained through research, instruction, investigation, or reading the news.
  • Information is known by many different names, including intelligence, message, data, signal, and fact.
  • Information helps to avoid study duplication. Information stimulates the cognitive processes of users, particularly scholars.
  • Scientists, engineers, academics, and others benefit from the use of information.

To learn more about Information, refer to:

brainly.com/question/4231278

#SPJ4

5 0
1 year ago
Define computer architecture?
tia_tia [17]

Answer:

computer architecture is a set of rules and methods that describe the functionality, organization, and implementation of computer systems. The architecture of a system refers to its structure in terms of separately specified components of that system and their interrelationships.

4 0
2 years ago
Which step do you think is most useful from big data life cycle.why?
12345 [234]

Explanation:

Business xase evaluation is most useful because (BCA) provides a best-value analysis that considers not only cost but other quantifiable and non-quantifiable factors supporting an investment decision. This can include but is not limited to, performance, producibility, reliability, maintainability, and supportability enhancements.

Mark me brainliest

7 0
2 years ago
You are the network administrator for a small organization of 100 users. Users till now were freely browsing the Internet. You w
Schach [20]

Answer: Proxy server

Explanation: Proxy server is a type of server that is acts as interface between the network on huge scale and any local network. This server provides the feature of security, operations, privacy etc in the network system. They also help in improving the performance of the network.

It can work as the web filter to eliminate the unwanted websites.They acts as the gateway by  observing the website that is being browsed by the other user.Thus installation of proxy server should implemented on the organization.

8 0
3 years ago
1. Actuators apply mechanical force in the form of pressure to overcome
Harman [31]
The answer is d torque because
3 0
3 years ago
Other questions:
  • What type of device is built into a tablet computer and can send data over radio waves to another device such as a laser printer
    10·1 answer
  • What are the desirable qualities of a Product Vision?
    11·1 answer
  • Which language is the most popular language for writing apple os x?
    9·1 answer
  • Can anyone can tell me and explain me the answer of it please .<br>thanks
    9·1 answer
  • Which option should you select to accept a tracked change? A. Accept B. Reject C. Review D. Delete
    8·2 answers
  • With which feature or menu option of a word processing program can you make an image like this?
    14·2 answers
  • Choose ALL guidelines listed below pertaining to fair use.
    12·2 answers
  • To make the most informed purchasing decision, you should:
    11·1 answer
  • When dividing it’s total debt by total equity what’s a company trying to measure
    9·1 answer
  • Show me how to create an argument essayshow me how to create an argument essay ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!