This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
3
[Question] Why is permutations of a string n(n!) time complexity?
Author Summary
vanmoonshine is
in
Question
Post Body
When coding for permutations it appears there is an outer for loop and an inner for loop that runs recursively with n-1 string length and a prefix. So my question is why is it n(n!) opposed to just n!? Since the recursive call starts with n-1 shouldn't it run n! because when it bubbles up to the highest level it'll result in the last calls being (n * n-1) opposed to (nnn-1)? Any clarification on this would be amazing.
Author
Account Strength
90%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,580
Link Karma
3,039
Comment Karma
1,541
Profile updated: 4 days ago
Posts updated: 4 weeks ago
Subreddit
Post Details
Location
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/AskProgramm...