mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-06 17:29:31 +08:00
style: use proper spelling (#5436)
checkstyle: fix typos, style Co-authored-by: alxkm <alx@alx.com> Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:
@ -14,8 +14,8 @@ import java.util.Arrays;
|
||||
*
|
||||
* Output : YES
|
||||
*/
|
||||
public final class BipartiteGrapfDFS {
|
||||
private BipartiteGrapfDFS() {
|
||||
public final class BipartiteGraphDFS {
|
||||
private BipartiteGraphDFS() {
|
||||
}
|
||||
|
||||
private static boolean bipartite(int v, ArrayList<ArrayList<Integer>> adj, int[] color, int node) {
|
@ -7,7 +7,7 @@ import java.util.PriorityQueue;
|
||||
/**
|
||||
* @author Arun Pandey (https://github.com/pandeyarun709)
|
||||
*/
|
||||
public class MergeKSortedLinkedlist {
|
||||
public class MergeKSortedLinkedList {
|
||||
|
||||
/**
|
||||
* This function merge K sorted LinkedList
|
@ -11,7 +11,7 @@ public final class LargestRectangle {
|
||||
private LargestRectangle() {
|
||||
}
|
||||
|
||||
public static String largestRectanglehistogram(int[] heights) {
|
||||
public static String largestRectangleHistogram(int[] heights) {
|
||||
int n = heights.length;
|
||||
int maxArea = 0;
|
||||
Stack<int[]> st = new Stack<>();
|
||||
@ -32,7 +32,7 @@ public final class LargestRectangle {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
assert largestRectanglehistogram(new int[] {2, 1, 5, 6, 2, 3}).equals("10");
|
||||
assert largestRectanglehistogram(new int[] {2, 4}).equals("4");
|
||||
assert largestRectangleHistogram(new int[] {2, 1, 5, 6, 2, 3}).equals("10");
|
||||
assert largestRectangleHistogram(new int[] {2, 4}).equals("4");
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ public final class ReverseWordsInString {
|
||||
* @param s the input string
|
||||
* @return A string created by reversing the order of the words in {@code s}
|
||||
*/
|
||||
|
||||
public static String reverseWordsInString(final String s) {
|
||||
var words = s.trim().split("\\s+");
|
||||
Collections.reverse(Arrays.asList(words));
|
||||
|
@ -15,13 +15,13 @@ public final class Upper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts all of the characters in this {@code String} to upper case
|
||||
* Converts all the characters in this {@code String} to upper case
|
||||
*
|
||||
* @param s the string to convert
|
||||
* @return the {@code String}, converted to uppercase.
|
||||
*/
|
||||
public static String toUpperCase(String s) {
|
||||
if (s == null || "".equals(s)) {
|
||||
if (s == null || s.isEmpty()) {
|
||||
return s;
|
||||
}
|
||||
char[] values = s.toCharArray();
|
||||
|
Reference in New Issue
Block a user