Programming Competition and Programming Interview questions. And maybe some web stuff, too.
Book: Cracking the Coding Interview Question: 11.2 (page 121)
Write a method to sort an array of strings so that all the anagrams are next to each other.
Solution: Complexity - O(nlogn) [because of TreeMap]
No comments:
Post a Comment