This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BooleanParenthesizaton { | |
public static void main (String args[]) { | |
char[] symbol = {'T', 'T', 'F', 'T'}; | |
har[] operator = {'|', '&', '^'}; | |
BooleanParenthesizaton bP = new BooleanParenthesizaton(); | |
System.out.println(bP.countWaysToParenthesize(symbol, operator)); | |
} | |
public int countWaysToParenthesize(char[] symbol, char[] operator) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WordPath{ | |
class Coordinate{ | |
public int x; | |
public int y; | |
public Coordinate(int x, int y){ | |
this.x = x; | |
this.y = y; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Stack; | |
public class Calculator { | |
public enum Operator{ADD, SUBTRACT, MULTIPLY, DIVIDE, BLANK} | |
public static void main(String[] args){ | |
String expression = "2-6-7*8/2+5"; | |
Calculator calc = new Calculator(); | |
System.out.println(calc.compute(expression)); |