Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPermutation ¶
IsPermutation returns true if strings are permutations of each other. It sorts each rune in the string and then compares them for equality. Since each string is sorted runtime is O(N log N) where N=len(s1)+len(s2)
func IsPermutationDS ¶
IsPermutationDS returns true if strings are permutations of each other. It uses a map of space O(N) to count occurrences of runes in one string. It then removes each rune occurrence that appears in the second string. Runtime is O(N) thanks to the map.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.