194 Commits

Author SHA1 Message Date
86d333ee94 feat: Test running overhaul, switch to Prettier & reformat everything (#1407)
* chore: Switch to Node 20 + Vitest

* chore: migrate to vitest mock functions

* chore: code style (switch to prettier)

* test: re-enable long-running test

Seems the switch to Node 20 and Vitest has vastly improved the code's and / or the test's runtime!

see #1193

* chore: code style

* chore: fix failing tests

* Updated Documentation in README.md

* Update contribution guidelines to state usage of Prettier

* fix: set prettier printWidth back to 80

* chore: apply updated code style automatically

* fix: set prettier line endings to lf again

* chore: apply updated code style automatically

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-04 02:38:19 +05:30
6debd5c1a2 chore: 🤖 remove extra lines (#1330)
I ran the command yarn style and that got failed, so I fixed that
2023-06-17 01:49:21 +05:30
1381ed0c17 feat: add dutchNationalFlagSort implementation (#1305)
* feat: add dutchNationalFlagSort implementation

* fix: add test, fit code style

* fix: add link to directory.md
2023-03-04 10:39:21 +05:30
002b10a5aa docs: fix typos (#1283)
* docs: fix typos

* fix
2023-02-07 22:20:28 +05:30
18baef8e7e feat: insertion sort with binary search (#1182) 2022-10-16 10:47:18 +02:00
32b9a9900e Swapsort algorithm and corresponding tests (#1152) 2022-10-13 17:26:31 +05:30
d3cec8b28f merge: Rename secondLargestElement.test.js to SecondLargestElement.test.js (#1039) 2022-06-06 14:02:12 +05:30
c105c4d0a2 merge: Rename pigeonHoleSort.test.js to PigeonHoleSort.test.js (#1038) 2022-06-05 22:29:06 +05:30
61ee22459b merge: Add test case to Find Second Largest Element Algorithm (#1037) 2022-06-05 08:51:58 +05:30
dbffac253d merge: FindSecondLargestElement: Support negative numbers (#1036)
* FindSecondLargestElement: Support negative numbers

* Updated Documentation in README.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-06-03 22:37:49 +05:30
0dccd280f3 merge: fix typo(change file name) (#1034) 2022-06-02 12:03:04 +05:30
d28ae8b1f7 merge: Update test case for bubbleSort ( with code style is fixed) (#1020)
* Update test case for bubbleSort

* re-update test case for bubble sort

* re-update test case for bubbleSort
2022-05-23 22:27:11 +05:30
01db0fb369 Fix wiggle sort (#991)
Co-authored-by: Antonia Strack <antonia.strack@thm.mni.de>
2022-04-28 12:16:13 +02:00
2e18fbb39a merge: Add the Stooge Sort Algorithm (#998)
* Add stooge sort sorting algorithm with included tests

* Add stooge sort sorting algorithm with included tests

* Add correct url for more information

* Add time complexity warning
2022-04-28 13:47:23 +05:30
eb36e2de62 merge: Format codebase with standard.js (#989)
* Auto-update DIRECTORY.md

* fix: some redundancy according to standard javascript library

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-04-21 11:38:38 +05:30
35035f7afa merge: Add test case and fix TimSort algo (#977) 2022-04-03 16:28:36 +05:30
2169e17d47 merge: Add test case to shellSort algorithm (#975) 2022-04-03 16:27:56 +05:30
6f33f990f2 merge: Add test case and fix pigeonHoleSort Algorithm (#967) 2022-04-01 12:28:43 +05:30
871a49f3cd merge: test case to radixSort Algorithm (#968) 2022-04-01 12:28:12 +05:30
d47555b026 merge: Add test case and fix HeapSort Algorithm (#969) 2022-03-31 19:27:44 +05:30
d6a327a988 merge: Add test case and fix the OddEvenSort Algorithm (#955) 2022-03-27 22:45:46 +05:30
55da7a1d7c merge: Add test case to HeapSort Algorithm (#947) 2022-03-24 21:50:57 +05:30
73efc89d29 merge: Fix GnomeSort algorithm and Add test case to it (#948) 2022-03-24 21:50:39 +05:30
532cf3e613 merge: Add test case to FlashSort algorithm (#946) 2022-03-24 21:50:21 +05:30
699146fb4e merge: Add test case to secondLargestElement Algorithm (#945) 2022-03-23 22:13:09 +05:30
ecf7cf9fe3 merge: Add test case to countingSort algorithm (#943) 2022-03-22 20:26:55 +05:30
00f593662b merge: Add alternative implementation for InsertionSort and relative test. Add additional algorithm description (#915)
Co-authored-by: Andrea Tota <tota@qi4m.com>
2022-03-04 19:41:37 +05:30
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