The Big O complelxity of this algorithm?
Hey guys, Im working to get better at understanding Big O notation, and Im trying to figure out the complexity of this algorithm. Its a cartesian product, returning all the permutations of a number of sets, and I've read that this is o(n2) but this algorithm uses three foureach loops, so that would make it O(n3), is that correct?
Im not sure I fully understand how to determine the complexity. Any help would be great, thanks.
Edit: I should note that in the above code, I used a and b as examples, but that might be a,b,c,d,e,f etc etc. The first list can have any number of values, and each nested list will have 2 or more values.
Submitted July 12, 2017 at 09:01AM by Kerbobotat
via reddit http://ift.tt/2sPzi0p