You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/practice/parallel-letter-frequency/.approaches/fork-join/content.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,24 +71,21 @@ Using [`ConcurrentHashMap`][ConcurrentHashMap] ensures that frequency counting a
71
71
If there are no strings, a validation step prevents unnecessary processing.
72
72
73
73
A [`ForkJoinPool`][ForkJoinPool] is then created.
74
-
75
74
The core of [`ForkJoinPool`][ForkJoinPool] is the Fork/Join mechanism, which divides tasks into smaller units and processes them in parallel.
76
75
77
-
THRESHOLD is the criterion for task division.
78
-
79
-
If the range of texts exceeds the THRESHOLD, the task is divided into two subtasks, and [`invokeAll`][invokeAll](leftTask, rightTask) is called to execute both tasks in parallel.
80
-
81
-
Each subtask in LetterCountTask will continue calling compute() to divide itself further until the range is smaller than or equal to the threshold.
82
-
83
-
For tasks that are within the threshold, letter frequency is calculated.
76
+
`THRESHOLD` is the criterion for task division.
77
+
If the range of texts exceeds the `THRESHOLD`, the task is divided into two subtasks, and [`invokeAll(leftTask, rightTask)`][invokeAll] is called to execute both tasks in parallel.
78
+
Each subtask in LetterCountTask will continue calling compute() to divide itself further until the range is smaller than or equal to the `THRESHOLD`.
79
+
For tasks that are within the `THRESHOLD`, letter frequency is calculated.
84
80
85
-
The [`Character.isAlphabetic`][isAlphabetic] method is used to identify all characters classified as alphabetic in Unicode, covering various languages like English, Korean, Japanese, Chinese, etc., returning true for alphabetic characters and false for numbers, special characters, spaces, and others.
81
+
The [`Character.isAlphabetic`][isAlphabetic] method identifies all characters classified as alphabetic in Unicode, covering characters from various languages like English, Korean, Japanese, Chinese, etc., returning `true`.
82
+
Non-alphabetic characters, including numbers, special characters, and spaces, return `false`.
86
83
87
-
Additionally, since uppercase and lowercase letters are treated as the same character (e.g., A and a), each character is converted to lowercase.
84
+
Additionally, since uppercase and lowercase letters are treated as the same character (e.g., `A` and `a`), each character is converted to lowercase.
88
85
89
86
After updating letter frequencies, the final map is returned.
0 commit comments