Skip to content

Commit 13a385d

Browse files
Merge branch 'master' into fix-fix-aes-decrypted-text-logging-v001
2 parents ea7f3bc + 0ad5d90 commit 13a385d

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/main/java/com/thealgorithms/conversions/AnyBaseToAnyBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* <p>
44
* Time Complexity: O(n) [or appropriate complexity]
55
* Space Complexity: O(n)
6-
* * @author Reshma Kakkirala
6+
* @author Reshma Kakkirala
77
*/
88
package com.thealgorithms.conversions;
99

src/main/java/com/thealgorithms/searches/SentinelLinearSearch.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public <T extends Comparable<T>> int find(T[] array, T key) {
6565

6666
int i = 0;
6767
// Search without bound checking since sentinel guarantees we'll find the key
68-
while (array[i].compareTo(key) != 0) {
68+
// Null check for array element to prevent NPE when array contains null elements
69+
while (array[i] != null && array[i].compareTo(key) != 0) {
6970
i++;
7071
}
7172

src/main/java/com/thealgorithms/strings/ReverseString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static String reverse3(String string) {
6262
/**
6363
* Reverses the given string using a stack.
6464
* This method uses a stack to reverse the characters of the string.
65-
* * @param str The input string to be reversed.
65+
* @param str The input string to be reversed.
6666
* @return The reversed string.
6767
*/
6868
public static String reverseStringUsingStack(String str) {

0 commit comments

Comments
 (0)