Skip to content

Commit faf10e0

Browse files
committed
docs: update fork-join content
1 parent 42bee45 commit faf10e0

File tree

1 file changed

+8
-11
lines changed
  • exercises/practice/parallel-letter-frequency/.approaches/fork-join

1 file changed

+8
-11
lines changed

exercises/practice/parallel-letter-frequency/.approaches/fork-join/content.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,21 @@ Using [`ConcurrentHashMap`][ConcurrentHashMap] ensures that frequency counting a
7171
If there are no strings, a validation step prevents unnecessary processing.
7272

7373
A [`ForkJoinPool`][ForkJoinPool] is then created.
74-
7574
The core of [`ForkJoinPool`][ForkJoinPool] is the Fork/Join mechanism, which divides tasks into smaller units and processes them in parallel.
7675

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.
8480

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`.
8683

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.
8885

8986
After updating letter frequencies, the final map is returned.
9087

9188
[ConcurrentHashMap]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html
9289
[ForkJoinPool]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPool.html
9390
[isAlphabetic]: https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html#isAlphabetic-int-
94-
[invokeAll]: https://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html
91+
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html

0 commit comments

Comments
 (0)