What is an example (in code) of a O(n!) function? It should take appropriate number of operations to run in reference to n; that is, I\'m asking a
O(n!)
n
the simplest example :)
pseudocode:
input N calculate N! and store the value in a vaiable NFac - this operation is o(N) loop from 1 to NFac and output the letter 'z' - this is O(N!)
there you go :)
As a real example - what about generating all the permutations of a set of items?