mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-26 15:11:16 +08:00
Code style fixes.
This commit is contained in:
parent
caec97e562
commit
625217a9c2
@ -2,7 +2,7 @@ import Sort from '../Sort';
|
||||
|
||||
// Using charCode (a = 97, b = 98, etc), we can map characters to buckets from 0 - 25
|
||||
const BASE_CHAR_CODE = 97;
|
||||
const NUMBER_OF_DIGITS = 10;
|
||||
const NUMBER_OF_POSSIBLE_DIGITS = 10;
|
||||
const ENGLISH_ALPHABET_LENGTH = 26;
|
||||
|
||||
export default class RadixSort extends Sort {
|
||||
@ -40,7 +40,7 @@ export default class RadixSort extends Sort {
|
||||
// See below. These are used to determine which digit to use for bucket allocation
|
||||
const modded = 10 ** (index + 1);
|
||||
const divided = 10 ** index;
|
||||
const buckets = this.createBuckets(NUMBER_OF_DIGITS);
|
||||
const buckets = this.createBuckets(NUMBER_OF_POSSIBLE_DIGITS);
|
||||
|
||||
array.forEach((element) => {
|
||||
this.callbacks.visitingCallback(element);
|
||||
|
Loading…
Reference in New Issue
Block a user