Tongue-in-cheek O(NlogN) solution
Perform an FFT on your string (treating characters as numeric values). Every peak in the resulting graph corresponds to a substring periodicity.
More Related Contents:
- Print two-dimensional array in spiral order
- In-place array reordering?
- How to find max. and min. in array using minimum comparisons?
- maximize the top element of the stack after performing exactly K operations
- Algorithm for all subsets of Array
- Searching array reports “not found” even though it’s found
- Finding three elements in an array whose sum is closest to a given number
- Array versus linked-list
- How to find the kth smallest element in the union of two sorted arrays?
- Algorithm to find k smallest numbers in array of n items
- Can min/max of moving window achieve in O(N)?
- Weighted random selection from array
- Find the Smallest Integer Not in a List
- How to find a duplicate element in an array of shuffled consecutive integers?
- Binary Search in Array
- Find the majority element in array
- Given an array, find out the next smaller element for each element
- Finding neighbours in a two-dimensional array
- Binary Search algorithm implementations
- Algorithm to determine if array contains n…n+m?
- Find the 2nd largest element in an array with minimum number of comparisons
- Algorithm to rotate an array in linear time
- Find all subsets of length k in an array
- Median of 5 sorted arrays
- find pair of numbers in array that add to given sum
- Interview question: three arrays and O(N*N)
- Maximum sum of non consecutive elements
- calculating the number of “inversions” in a permutation
- Algorithm to apply permutation in constant memory space
- Find the first element in a sorted array that is greater than the target