Fixed some typos and links for javadoc, and some refactoring (#4755)

This commit is contained in:
Ayoub Chegraoui 2023-10-15 15:02:24 +01:00 committed by GitHub
parent 48ae88f09d
commit 8002137b76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 12 deletions

View File

@ -19,7 +19,7 @@ public class AESEncryption {
/** /**
* 1. Generate a plain text for encryption 2. Get a secret key (printed in * 1. Generate a plain text for encryption 2. Get a secret key (printed in
* hexadecimal form). In actual use this must by encrypted and kept safe. * hexadecimal form). In actual use this must be encrypted and kept safe.
* The same key is required for decryption. * The same key is required for decryption.
*/ */
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {

View File

@ -1,7 +1,7 @@
package com.thealgorithms.conversions; package com.thealgorithms.conversions;
/** /**
* @author Varun Upadhyay (https://github.com/varunu28) * @author Varun Upadhyay (<a href="https://github.com/varunu28">...</a>)
*/ */
// Driver program // Driver program
public class AnyBaseToDecimal { public class AnyBaseToDecimal {

View File

@ -5,7 +5,7 @@ import java.io.InputStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
* @author Varun Upadhyay (https://github.com/varunu28) * @author Varun Upadhyay (<a href="https://github.com/varunu28">...</a>)
*/ */
// Driver Program // Driver Program
public class DecimalToAnyBase { public class DecimalToAnyBase {

View File

@ -10,8 +10,8 @@ import java.util.Arrays;
* models how colors appear under light. In it, colors are represented using * models how colors appear under light. In it, colors are represented using
* three components: hue, saturation and (brightness-)value. This class provides * three components: hue, saturation and (brightness-)value. This class provides
* methods for converting colors from one representation to the other. * methods for converting colors from one representation to the other.
* (description adapted from https://en.wikipedia.org/wiki/RGB_color_model and * (description adapted from <a href="https://en.wikipedia.org/wiki/RGB_color_model">[1]</a> and
* https://en.wikipedia.org/wiki/HSL_and_HSV). * <a href="https://en.wikipedia.org/wiki/HSL_and_HSV">[2]</a>).
*/ */
public class RgbHsvConversion { public class RgbHsvConversion {

View File

@ -6,7 +6,7 @@ import java.util.Stack;
/* /*
* A Java program that computes the convex hull using the Graham Scan algorithm * A Java program that computes the convex hull using the Graham Scan algorithm
* In the best case, time complexity is O(n), while in the worst case, it is log(n). * In the best case, time complexity is O(n), while in the worst case, it is O(nlog(n)).
* O(n) space complexity * O(n) space complexity
* *
* This algorithm is only applicable to integral coordinates. * This algorithm is only applicable to integral coordinates.
@ -106,16 +106,14 @@ public class GrahamScan {
/** /**
* @param p2 Co-ordinate of point to compare to. * @param p2 Co-ordinate of point to compare to.
* This function will compare the points and will return a positive integer it the * This function will compare the points and will return a positive integer if the
* point is greater than the argument point and a negative integer if the point is * point is greater than the argument point and a negative integer if the point is
* less than the argument point. * less than the argument point.
*/ */
public int compareTo(Point p2) { public int compareTo(Point p2) {
if (this.y < p2.y) return -1; int res = Integer.compare(this.y, p2.y);
if (this.y > p2.y) return +1; if (res == 0) res = Integer.compare(this.x, p2.x);
if (this.x < p2.x) return -1; return res;
if (this.x > p2.x) return +1;
return 0;
} }
/** /**