Skip to content

Commit 5d293e4

Browse files
committed
docs: fix typos
1 parent 28c0175 commit 5d293e4

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Gradle is used for development.
7979
* [Radix Sort](src/main/java/algorithms/sorting/radixSort) (found in tutorial)
8080
4. Trees
8181
* [Binary search tree](src/main/java/dataStructures/binarySearchTree)
82-
* AVL-tree
82+
* [AVL-tree](src/main/java/dataStructures/avlTree)
8383
* Orthogonal Range Searching
8484
* [Trie](src/main/java/dataStructures/trie)
8585
* [B-Tree](src/main/java/dataStructures/bTree)

src/main/java/algorithms/sorting/countingSort/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Counting sort is a non-comparison-based sorting algorithm and isn't bounded by t
66
of most sorting algorithms. <br>
77
It first obtains the frequency map of all elements (i.e. counting the occurrence of every element), then
88
computes the prefix sum for the map. This prefix map tells us which position an element should be inserted.
9-
It is updated after each insertion to reflection the new position to insert the next time the same element is
9+
It is updated after each insertion to reflect the new position to insert the next time the same element is
1010
encountered. <br>
1111

1212
![counting sort img](../../../../../../docs/assets/images/CountingSort.png)
@@ -41,5 +41,7 @@ Counting sort is NOT AN IN-PLACE algorithm. For one, it requires additional spac
4141

4242
## Notes
4343

44-
1. Counting sort (stable version) is often used as a sub-routine for radix sort.
45-
2. Supplementary: Here is a [video](https://www.youtube.com/watch?v=OKd534EWcdk) if you are still having troubles.
44+
1. Our counting sort implementation works only on non-negative integers. However, to adapt it to work for arrays with
45+
negative integers, we can add an offset of +m, where m is the smallest integer in the array.
46+
2. Counting sort (stable version) is often used as a sub-routine for radix sort.
47+
3. Supplementary: Here is a [video](https://www.youtube.com/watch?v=OKd534EWcdk) if you are still having troubles.

src/main/java/algorithms/sorting/radixSort/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ In practice, numbers are often interpreted in their binary representation, with
3131
bit chunk of a specified size (usually 8 bits/1 byte, though this number could vary for optimization).
3232

3333
For our implementation, we utilize the binary representation of elements, partitioning them into 8-bit segments.
34-
Given that an integer is typically represented in 32 bits, this results in four segments per integer.
34+
Given that an integer is typically represented in 32 bits, this results in four segments.
3535
By applying the sorting subroutine to each segment across all integers, we can efficiently sort the array.
36-
This method requires sorting the array four times in total, once for each 8-bit segment,
36+
This method requires sorting the array four times in total, once for each 8-bit segment.
3737

3838
### Implementation Invariant
3939
At the end of the *ith* iteration, the elements are sorted based on their numeric value up till the *ith* segment.

0 commit comments

Comments
 (0)