Java Implementation of Dijkstra's Two Stack Algorithm