Skip to content

Instantly share code, notes, and snippets.

@wnds
wnds / ExpressionChecker.java
Created January 3, 2013 09:52
Algorithms Sedgewick - 1.3.4 Write a stack client Parenthesesthat reads in a text stream from standard input and uses a stack to determine whether its parentheses are properly balanced. For ex-ample, your program should print truefor [()]{}{[()()]()}and falsefor[(]).
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.Scanner;
import java.util.Stack;
import static java.lang.System.in;
import static java.lang.System.out;
/**