chore: fix some comments (#5333)
This commit is contained in:
parent
98bee26d51
commit
7c58b190c8
@ -19,7 +19,7 @@ public final class ParenthesesGenerator {
|
||||
*/
|
||||
public static List<String> generateParentheses(final int n) {
|
||||
if (n < 0) {
|
||||
throw new IllegalArgumentException("The number of pairs of parentheses cannot be nagative");
|
||||
throw new IllegalArgumentException("The number of pairs of parentheses cannot be negative");
|
||||
}
|
||||
List<String> result = new ArrayList<>();
|
||||
generateParenthesesHelper(result, "", 0, 0, n);
|
||||
|
@ -95,7 +95,7 @@ public class BSTRecursive {
|
||||
}
|
||||
|
||||
/**
|
||||
* Serach recursively if the given value is present in BST or not.
|
||||
* Search recursively if the given value is present in BST or not.
|
||||
*
|
||||
* @param node the current node to check
|
||||
* @param data the value to be checked
|
||||
|
@ -6,7 +6,7 @@ public final class PalindromePrime {
|
||||
private PalindromePrime() {
|
||||
}
|
||||
|
||||
public static void main(String[] args) { // Main funtion
|
||||
public static void main(String[] args) { // Main function
|
||||
Scanner in = new Scanner(System.in);
|
||||
System.out.println("Enter the quantity of First Palindromic Primes you want");
|
||||
int n = in.nextInt(); // Input of how many first palindromic prime we want
|
||||
|
@ -17,7 +17,7 @@ import java.util.Scanner;
|
||||
from its initial sorted position.
|
||||
Eg. For [2,5,6,8,11,12,15,18], 1 rotation gives [5,6,8,11,12,15,18,2], 2 rotations
|
||||
[6,8,11,12,15,18,2,5] and so on. Finding the minimum element will take O(N) time but, we can use
|
||||
Binary Search to find the mimimum element, we can reduce the complexity to O(log N). If we look
|
||||
Binary Search to find the minimum element, we can reduce the complexity to O(log N). If we look
|
||||
at the rotated array, to identify the minimum element (say a[i]), we observe that
|
||||
a[i-1]>a[i]<a[i+1].
|
||||
|
||||
|
@ -40,7 +40,7 @@ class FFTTest {
|
||||
assertNotEquals(2.0, add);
|
||||
}
|
||||
|
||||
// Testing the function substract, assertEqual test
|
||||
// Testing the function subtract, assertEqual test
|
||||
@Test
|
||||
void subtractTest() {
|
||||
FFT.Complex complex1 = new FFT.Complex(2.0, 2.0);
|
||||
|
Loading…
Reference in New Issue
Block a user