Well, I donβt quite understand the limitations of creating additional arrays. But essentially, we randomly generate an index, and then repeat, regenerating, if we get into the index that we have already reached. It is not necessarily effective. But I would venture to suggest that the border is, of course, between O (n ^ 2) and O (n!) (Possibly (O (n ^ n)). With a little work, we could clear this and get almost always fall on n ^ 2.
source share