Hamiltonian paths and circuits in graphs and tournaments