java - Checking if two strings are permutations of each other -
To determine whether two strings are permutations of each other
< Div class =
Edit:
The above method is quite efficient - O (n * log (n)) and, as shown by others Is the standard java API Even more efficient (but more than that) the calculation and comparison of the occurrence of each character, will be used as an index of values in the form of an index.
I do not think this is an effective way of doing this recursively
- If both strings meet the same character, then the correct return
- Remove a letter from the first letter
- View the second string for the occurrence of this character
- If it does not exist then False return
- Otherwise, delete the deleted character and apply the rearranged algorithm to those who have two strings Please.
Comments
Post a Comment