text: Number of Hamiltonian cycle | Function that calculates number of Hamiltonian cycle ; Calculating factorial ; Driver code
code: < ? php function Cycles ( $ N ) { $ fact = 1 ; $ result = 0 ; $ result = $ N - 1 ; $ i = $ result ; while ( $ i > 0 ) { $ fact = $ fact * $ i ; $ i -- ; } return floor ( $ fact / 2 ) ; } $ N = 5 ; $ Number = Cycles ( $ N ) ; echo " Hamiltonian ▁ cycles ▁ = ▁ " , $ Number ; ? >