depth first traversal, pre order