Skip to content

Commit 9e6050b

Browse files
committed
docs: minor formatting
1 parent 1a499ec commit 9e6050b

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

README.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "Essential Code Snippets Library for Java Developers"
2+
title: 'Essential Code Snippets Library for Java Developers'
33
shortTitle: Code Snippets Library
4-
description: "Access a wide range of Java code snippets for implementing design patterns effectively. Our library offers ready-to-use examples to help you improve your coding and design skills."
4+
description: 'Access a wide range of Java code snippets for implementing design patterns effectively. Our library offers ready-to-use examples to help you improve your coding and design skills.'
55
language: en
66
---
77

@@ -92,7 +92,7 @@ public class BinarySearchSnippet {
9292
*
9393
* @param arr sorted array to search
9494
* @param item an item to search
95-
* @return if item is found, return the index position of the array item otherwise return -1
95+
* @return if item is found, return the index position of the array item, otherwise return -1
9696
*/
9797

9898
public static int binarySearch(int[] arr, int left, int right, int item) {
@@ -109,7 +109,7 @@ public class BinarySearchSnippet {
109109
return binarySearch(arr, mid + 1, right, item);
110110
}
111111
return -1;
112-
}
112+
}
113113
}
114114
```
115115

@@ -279,8 +279,8 @@ public class LinearSearchSnippet {
279279
}
280280
}
281281
```
282-
### Luhn Mod N
283282

283+
### Luhn Mod N
284284

285285
```java
286286
public class LuhnModnSnippet {
@@ -526,6 +526,7 @@ public class SieveOfEratosthenesSnippet {
526526
}
527527
}
528528
```
529+
529530
### Verhoeff
530531

531532
```java
@@ -787,7 +788,7 @@ public class FindMaxSnippet {
787788

788789
```java
789790
public class FindMinSnippet {
790-
791+
791792
/**
792793
* Returns the minimum integer from the array using reduction.
793794
*
@@ -1190,14 +1191,14 @@ public class ZipDirectorySnippet {
11901191
}
11911192

11921193
/**
1193-
* Utility function which either zips a single file, or recursively calls itself for
1194+
* Utility function which either zips a single file, or recursively calls itself for
11941195
* a directory to traverse down to the files contained within it.
11951196
*
11961197
* @param fileToZip The file as a resource
11971198
* @param fileName The actual name of the file
11981199
* @param zipOut The output stream to which all data is being written
11991200
* */
1200-
public static void zipFile(File fileToZip, String fileName, ZipOutputStream zipOut)
1201+
public static void zipFile(File fileToZip, String fileName, ZipOutputStream zipOut)
12011202
throws IOException {
12021203
if (fileToZip.isHidden()) { // Ignore hidden files as standard
12031204
return;
@@ -1410,7 +1411,7 @@ public class EloRatingSnippet {
14101411
double logisticDiff = Math.pow(10, ratingDiff);
14111412
double firstPlayerExpectedScore = 1.0 / (1 + logisticDiff);
14121413
double firstPlayerActualScore = result;
1413-
double newRating = firstPlayerRating + RATING_ADJUSTMENT_FACTOR * (firstPlayerActualScore
1414+
double newRating = firstPlayerRating + RATING_ADJUSTMENT_FACTOR * (firstPlayerActualScore
14141415
- firstPlayerExpectedScore);
14151416
return newRating;
14161417
}
@@ -1778,9 +1779,9 @@ public class PrimeNumberSnippet {
17781779
public class RandomNumber {
17791780

17801781
private RandomNumber() {}
1781-
1782+
17821783
private static Random random = new Random();
1783-
1784+
17841785
/**
17851786
* Return a random number between two given numbers.
17861787
*
@@ -1789,7 +1790,7 @@ public class RandomNumber {
17891790
* @return Number denoting the random number generated
17901791
*/
17911792
public static <T extends Number> Number getRandomNumber(T start, T end) {
1792-
1793+
17931794
if (start instanceof Byte && end instanceof Byte) {
17941795
return (byte) (start.byteValue()
17951796
+ random.nextInt(end.byteValue() - start.byteValue() + 1));
@@ -1962,7 +1963,7 @@ public class AnagramSnippet {
19621963

19631964
var arr1 = new int[256];
19641965
var arr2 = new int[256];
1965-
1966+
19661967
for (var i = 0; i < l1; i++) {
19671968
arr1[s1.charAt(i)]++;
19681969
arr2[s2.charAt(i)]++;
@@ -2095,7 +2096,7 @@ public class LevenshteinDistanceSnippet {
20952096
}
20962097
```
20972098

2098-
### Lindenmayer System
2099+
### Lindenmayer System
20992100

21002101
```java
21012102
public class LindenmayerSystemSnippet {
@@ -2230,7 +2231,6 @@ public class StringToDateSnippet {
22302231
}
22312232
```
22322233

2233-
22342234
### KMP Substring Search Algorithm
22352235

22362236
```java
@@ -2302,7 +2302,6 @@ public class KMPSubstringSearchSnippet {
23022302
}
23032303
```
23042304

2305-
23062305
### Format Bytes
23072306

23082307
```java
@@ -2337,8 +2336,6 @@ public class FormatBytesSnippet {
23372336
}
23382337
```
23392338

2340-
2341-
23422339
## Thread
23432340

23442341
### Thread Pool
@@ -2374,6 +2371,7 @@ public class ThreadPool {
23742371
}
23752372
}
23762373
```
2374+
23772375
### Damm Algorithm
23782376

23792377
```java
@@ -2443,4 +2441,4 @@ public class DammSnippet {
24432441
return calculateCheckSumDigit(number) == 0;
24442442
}
24452443
}
2446-
```
2444+
```

0 commit comments

Comments
 (0)