Improved code readability and code quality (#4663)

* Fixed Small typos :-)

* Update BufferedReader.java

* Made the following changes :

* Improved readability of files and removed gramatical errors.

* Implemented data assigning instead of manually calling arr.ylength in several instances like FindMax, FindMaxRecursion etc.

* Removed unwanted params from several files

* Implemented Math methods in files math/FindMinRecursion.java and FindMaxRecursion.java

* Update src/main/java/com/thealgorithms/maths/FindMinRecursion.java

---------

Co-authored-by: Debasish Biswas <debasishbsws.dev@gmail.com>
This commit is contained in:
Abhinav Pandey
2023-10-11 17:29:55 +05:30
committed by GitHub
parent 17fe4298b6
commit 152e29034d
13 changed files with 41 additions and 31 deletions

View File

@@ -51,17 +51,17 @@ class DigitalRoot {
}
}
// This function is used for finding the sum of digits of number
// This function is used for finding the sum of the digits of number
public static int single(int n) {
if (n <= 9) { // if n becomes less than 10 than return n
return n;
} else {
return (n % 10) + single(n / 10); // n % 10 for extracting digits one by one
}
} // n / 10 is the number obtainded after removing the digit one by one
// Sum of digits is stored in the Stack memory and then finally returned
} // n / 10 is the number obtained after removing the digit one by one
// The Sum of digits is stored in the Stack memory and then finally returned
}
/**
* Time Complexity : O((Number of Digits)^2) Auxiliary Space Complexity :
* O(Number of Digits) Constraints : 1 <= n <= 10^7
* Time Complexity: O((Number of Digits)^2) Auxiliary Space Complexity:
* O(Number of Digits) Constraints: 1 <= n <= 10^7
*/