MCPcopy Index your code
hub / github.com/careercup/ctci / evaluate

Method evaluate

java/Chapter 9/Question9_11/Question.java:74–81  ·  view source on GitHub ↗
(String expression, int start, int end)

Source from the content-addressed store, hash-verified

72 }
73
74 public static boolean evaluate(String expression, int start, int end) {
75 String result = reduce(expression, start, end);
76 if (result == "0") {
77 return false;
78 } else {
79 return true;
80 }
81 }
82
83 public static boolean isOperator(char c) {
84 switch (c) {

Callers 1

bruteForceMethod · 0.95

Calls 1

reduceMethod · 0.95

Tested by

no test coverage detected