-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved distance calculation speed when a maximum cost is set.
- Reduced complexity from O(max(|s1|,|s2|)*maxCost) to O(min(|s1|,|s2|)*maxCost). - Bypass the calculation when distance is guaranteed to be greater than maxCost. - Added tests for more edge cases.
- Loading branch information
1 parent
3e941b9
commit 58b6ed8
Showing
3 changed files
with
63 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters