Skip to content

Commit

Permalink
Anagrams time complexity is same as its space complexity N!, we need …
Browse files Browse the repository at this point in the history
…to find the anagrams to save them. Hence both N!
  • Loading branch information
ajinkyakolhe112 committed Feb 9, 2016
1 parent bceffab commit 9aa3611
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/github/pedrovgs/problem25/Anagrams.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class Anagrams {

/**
* Combination of recursion and one iterative approach to resolve this problem. The complexity of
* this algorithm is O(N) where N is the size of the input. In space terms the complexity order
* this algorithm is O(N!) where N is the size of the input. In space terms the complexity order
* is related to the number of permutations equals to O(N!) where N is the number of chars in the
* input string.
*/
Expand Down

0 comments on commit 9aa3611

Please sign in to comment.