167 Commits

Author SHA1 Message Date
dbc98d096b merge: Bubble Sort enhancements for nearly sorted or sorted array, added test cases and documentation (#895)
* BubbleSort enacements for nearly sorted or sorted array and added test cases

* BubbleSort enacements for nearly sorted or sorted array and added test cases

* Bubble sort requested changes solved

* standard js style issue fixed
2022-02-19 17:53:54 +05:30
0aa5094bfd merge: add alphanumerical sort (#872)
* alphanumerical sort

* [/pull/872] add description to alphanumerical sort

* [/pull/872] add description to localCompare fn

* [/pull/872] code formatter
2021-12-20 22:23:28 +05:30
cc34088aae merge: Add Description and Optamization (#852) 2021-11-27 16:50:09 +05:30
d16336a000 chore: fix spelling
./Sorts/PancakeSort.js:36: essentialy ==> essentially
2021-10-28 13:51:11 +05:30
315db14c5f chore: fix spelling
./Sorts/IntroSort.js:303: Implented ==> Implemented
2021-10-28 13:50:05 +05:30
22ce7603e4 fix: standard style issues 2021-10-21 22:59:56 +05:30
d38ebe5199 chore: Merge pull request #768 from lvlte/issues/720
Changes for consolidation
2021-10-21 19:32:55 +05:30
9ed5d8cde6 Add Pancake Sort to the sorting algorithms 2021-10-21 09:48:53 -03:00
df4a783b06 Complying with JavaScript Standard Style (npx standard --fix). 2021-10-11 15:49:24 +02:00
74f296578a Search/Sorts algoruthms : remove live code & console.log, leave examples as comments. 2021-10-11 12:29:03 +02:00
b13b12e88c chore: merge Fix/742 migrate doctest to jest (#749)
* Remove QuickSelect doctest

There are more Jest test cases already.

* Remove AverageMedian doctest

Already migrated to jest

* Migrate doctest for BinaryExponentiationRecursive.js

(also remove inline "main" test method)

* Migrate doctest for EulersTotient.js

(also remove inline "main" test method)

* Migrate doctest for PrimeFactors.js

(also remove inline "main" test method)

* Migrate doctest for BogoSort.js

Re-write prototype-polluting helper methods, too.

(also remove inline test driver code)

* Migrate doctest for BeadSort.js

(also remove inline test driver code)

* Migrate doctest for BucketSort.js

(also remove inline test driver code)

* Migrate doctest for CocktailShakerSort.js

(also remove inline test driver code)

* Migrate doctest for MergeSort.js

(also remove inline test driver code)

* Migrate doctest for QuickSort.js

(also remove inline test driver code)

* Migrate doctest for ReverseString.js

(also remove inline test driver code)

* Migrate doctest for ReverseString.js

* Migrate doctest for ValidateEmail.js

* Migrate doctest for ConwaysGameOfLife.js

(remove the animate code, too)

* Remove TernarySearch doctest

Already migrated to jest

* Migrate doctest for BubbleSort.js

(also remove inline test driver code)

* Remove doctest from CI and from dependencies

relates to #742
fixes #586

* Migrate doctest for RgbHsvConversion.js

* Add --fix option to "standard" npm script

* Migrate doctest for BreadthFirstSearch.js

(also remove inline test driver code)

* Migrate doctest for BreadthFirstShortestPath.js

(also remove inline test driver code)

* Migrate doctest for EulerMethod.js

(also remove inline test driver code)

Move manual test-code for plotting stuff in the browser in a distinct file, too. Those "*.manual-test.js" files are excluded from the UpdateDirectory.mjs script, as well.

* Migrate doctest for Mandelbrot.js

(also remove inline test driver code & moved manual drawing test into a *.manual-test.js)

* Migrate doctest for FloodFill.js

* Migrate doctest for KochSnowflake.js

(also move manual drawing test into a *.manual-test.js)

* Update npm lockfile

* Update README and COMMITTING with a few bits & bobs regarding testing & code quality
2021-10-07 12:33:38 +05:30
83b840d691 Merge branch 'master' of github.com:charliejmoore/Javascript into cycle-sort-tests 2021-10-06 07:42:16 -04:00
134641443b Merge branch 'master' of github.com:charliejmoore/Javascript into cycle-sort-tests 2021-10-06 07:41:35 -04:00
2e6f8ae982 chore: Merge pull request #736 from charliejmoore/bucket-sort-tests
Bucket sort tests
2021-10-06 12:45:35 +05:30
6bb075df92 Group tests in a describe 2021-10-05 17:25:22 -04:00
6bba9da118 Group tests in a describe 2021-10-05 17:23:36 -04:00
11702cc033 Merge branch 'master' of github.com:charliejmoore/Javascript into comb-sort-tests 2021-10-05 09:02:26 -04:00
c83bc5ba6e Remove testing code in function file 2021-10-05 09:00:29 -04:00
fc07f38a0c Fix merge conflicts 2021-10-05 08:56:43 -04:00
932599d37b Remove testing code in function file 2021-10-05 08:54:13 -04:00
782386a11a Remove testing code in function file 2021-10-05 08:53:05 -04:00
1589263947 fixed some spellings 2021-10-05 12:49:23 +05:30
8e5743f8cb Fix standardjs style errors 2021-10-04 18:54:59 -04:00
519f557899 Add tests for CycleSort 2021-10-04 18:53:49 -04:00
0da3880955 Fix bug where cycleSort was not returning the sorted array 2021-10-04 18:53:03 -04:00
b3e6eed3ce Add export to CycleSort for Jest testing 2021-10-04 18:50:14 -04:00
720b7b054b Add function documentation to CycleSort 2021-10-04 18:49:54 -04:00
f4814ba143 Fix typo 2021-10-04 18:49:31 -04:00
7076c2afbf Fix style per standard js rules 2021-10-04 18:44:12 -04:00
7c0379c024 Add tests for CombSort 2021-10-04 18:43:54 -04:00
ea4e816b5e Add export of combSort for Jest testing 2021-10-04 18:42:49 -04:00
4ebe59345b Add function documentation to combSort function 2021-10-04 18:42:28 -04:00
11315ea449 Add tests for BucketSort 2021-10-04 18:36:19 -04:00
1e3648af5a Fix whitespace alignment 2021-10-04 18:35:00 -04:00
877356fbab Fix bug in bucketSort so that a comparison function is now provided to the sort function
The [built-in JavaScript sort method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) will
perform a lexicographical (aka alphabetical) order by converting the elements of the array to strings. This can yield unexpected results when sorting numbers.
A comparison function can be passed into the sort method to indicate how array elements should be compared.
2021-10-04 18:33:35 -04:00
269175689f Add function documentation to bucketSort 2021-10-04 18:27:17 -04:00
754f7b6b04 Export bucketSort function for Jest testing 2021-10-04 17:57:13 -04:00
55080ebffd Add a reference link for BucketSort 2021-10-04 17:56:51 -04:00
0fea99db49 Update FisherYatesShuffle.test.js
Updated fisherYatesShuffle to FisherYatesShuffle
2021-10-03 20:10:56 +05:30
6fdd267459 Update FisherYatesShuffle.js
removed console statement
2021-10-03 20:10:26 +05:30
0ada757576 Update FisherYatesShuffle.js
Splited initialized 'let' declarations into multiple statements
2021-10-03 20:08:02 +05:30
6b2840f579 Added Fisher Yates Algorithm 2021-10-03 15:40:45 +02:00
c198a9f53d Added test for ScrambleStrings and formatted folder structure for other folders 2021-10-03 17:28:17 +05:30
77a2411395 chore: merge add QuickSortRecursive method. (#690)
* add QuickSortRecursive method

* added an exception for test cases

* fix for test cases

* added test cases for QuickSortRecursive
2021-09-19 18:55:25 +05:30
0ad2c6e8f3 Update BubbleSort.js
Corrected spelling mistake
2021-09-04 00:18:49 -07:00
faed847317 Updated the count sort algorithm with stable implementation. Added ES6 syntactic sugar to the syntax. Removed the unwanted len variable and updated the comments 2021-08-08 17:21:05 +05:30
6232f8dd42 Updated the count sort algorithm with stable implementation. Added ES6 syntactic sugar to the syntax 2021-08-08 17:14:41 +05:30
c55ca93584 Updated the count sort algorithm with stable implementation. Added ES6 syntactic sugar to the syntax 2021-08-08 16:42:13 +05:30
376f60ddc6 Added the correct and stable version of count sort. Changed function declaration to ES6 style. 2021-08-06 22:54:48 +05:30
a36fbf988f chore: Fix style problems 2021-06-17 11:07:50 +05:30