Update Traversals.java

Method 3 / changed conditions for which methods execute after input given