O Running Time

Find the big-O running time of the following program that finds all lists with length equal to the length nn of an input list ll and elements only from the elements of the input list (the input list has no duplicate elements):

  • It has a list of lists AA to return, which begins containing one empty list

  • It repeats the following steps nn times

  • For each list mm in AA, it adds nn lists, the lists formed by adding each element of ll to mm (each of these will have one more element than mm), to another list BB

  • It assigns the value BB to AA


Problem Loading...

Note Loading...

Set Loading...