Added code for Tree exercises.