Java icon indicating copy to clipboard operation
Java copied to clipboard

feat:Add SwapNumbersUsingXor algo with JUnit tests

Open Tanmay-Singh3004 opened this issue 1 year ago • 1 comments

  • [x] I have read CONTRIBUTING.md.
  • [x] This pull request is all my own work -- I have not plagiarized it.
  • [x] All filenames are in PascalCase.
  • [x] All functions and variable names follow Java naming conventions.
  • [x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • [x] All new code is formatted with clang-format -i --style=file path/to/your/file.java

Tanmay-Singh3004 avatar Oct 12 '24 10:10 Tanmay-Singh3004

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 63.93%. Comparing base (4a03f42) to head (8094e2d). Report is 21 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5734      +/-   ##
============================================
+ Coverage     63.91%   63.93%   +0.02%     
- Complexity     4167     4169       +2     
============================================
  Files           582      583       +1     
  Lines         16302    16306       +4     
  Branches       3148     3148              
============================================
+ Hits          10419    10425       +6     
+ Misses         5457     5456       -1     
+ Partials        426      425       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Oct 12 '24 10:10 codecov-commenter

It's not an algorithm, it's a trick. You could just return [a, b] from the method and get the same result, so the xor in this method is not useful to the caller

siriak avatar Oct 13 '24 06:10 siriak