Skip to content

Add Minkowski distance algorithm #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 16, 2024

Conversation

Paulofalcao2002
Copy link
Contributor

Summary of the Change:

This pull request introduces the Minkowski distance algorithm, which calculates the distance between two points in an N-dimensional space for a given order. The Minkowski distance generalizes both the Manhattan distance (order = 1) and the Euclidean distance (order = 2). It is defined as the p-th root of the sum of the absolute differences raised to the power of p between the coordinates of the points. Source

Motivation

Similar to my previous contributions, I wanted to include this algorithm since it is present in other language repositories, such as Python.

  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Comments in areas I changed are up to date
  • I have added comments to hard-to-understand areas of my code
  • I have made corresponding changes to the README.md

Copy link

codecov bot commented Nov 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.16%. Comparing base (87776ee) to head (9dff52d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #497      +/-   ##
==========================================
+ Coverage   95.15%   95.16%   +0.01%     
==========================================
  Files         266      267       +1     
  Lines       10851    10860       +9     
  Branches     1526     1528       +2     
==========================================
+ Hits        10325    10335      +10     
  Misses        400      400              
+ Partials      126      125       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@siriak siriak enabled auto-merge (squash) November 16, 2024 22:11
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit c4091c7 into TheAlgorithms:master Nov 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants