A naive approach to solve this problem is to check whether the strings str1 and str2 are of equal length. If the length of both the strings is different, then str2 is not an anagram of str1. If str1 and str2 are of equal length, sort the characters in both strings. After sorting, iterate over the characters in both strings and check whether they are identical at each position. If all the characters are identical, return TRUE. Otherwise, return FALSE.
The time complexity of this approach is ...
A naive approach to solve this problem is to check whether the strings str1 and str2 are of equal length. If the length of both the strings is different, then str2 is not an anagram of str1. If str1 and str2 are of equal length, sort the characters in both strings. After sorting, iterate over the characters in both strings and check whether they are identical at each position. If all the characters are identical, return TRUE. Otherwise, return FALSE.
The time complexity of this approach is ...