Comments (10)
Can we build a benchmark to prove which one is faster or better than the other?
It would be cool to have a benchmark because then we would have proof that they are the same and have the same performance for multiple datasets. Hint: I doubt it.
Such a benchmark could be extended to do side-by-side performance tests of all 19 of our sort algorithms. Benchmarks are cool and they have the power to push our contributors to optimize.
from javascript.
Our test cases are when length < 2
so...
document.write([].isSorted()); // --> true
document.write([1].isSorted()); // --> true
Now comment out lines 10-13 and run again.
You will get the exact same results because the loop never runs.
Lines 10-13 can be deleted.
from javascript.
@cclauss It seems that both the implementations are exactly the same algorithmically.
from javascript.
Also, there's something more we can do. At least BogoSort has an isSorted
function and a shuffle
function. We can make use of these two functions to build our test sets for the whole sort/
.
from javascript.
;-) Are lines 10-13 needed?
Update: Proven with doctests in #171
from javascript.
;-) Are lines 10-13 needed?
If the loop starts with i=1
and compares this[i-1]
with this[i]
then it is, but no for the current code.
from javascript.
Does the loop ever execute at all?
from javascript.
Yes. It's kind of an extension for the Array object. That's why we can use it directly.
https://js.do/code/438412
from javascript.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from javascript.
Please reopen this issue once you commit the changes requested or make improvements on the code. Thank you for your contributions.
from javascript.
Related Issues (20)
- chore: fix / clean up jsdoc comments HOT 13
- Fet: add "M-Coloring" Problem in Backtracking HOT 1
- Fet: Octal To Binary Convertor HOT 1
- Fet: Added "Octal To Binary" in Coversion Section HOT 1
- [OTHER]: It is not looks good for create a separate section for connect with us section. HOT 1
- [FEATURE]: Last Element HOT 6
- [FEATURE]: Height of tree HOT 3
- [FEATURE]: Switch to Bun or Vitest for running tests HOT 6
- [Question]: How can i work on multiple file? do i have to wait for first pr to be merged? HOT 1
- [FEATURE]: Length Conversion HOT 1
- [FEATURE]: HOT 2
- [FEATURE]: Add a palindrome validating code in the "string" folder under Hacktoberfest HOT 3
- [OTHER]: Grammar Mistake HOT 1
- [OTHER]: Add gidpod ready to code badge in README.md HOT 1
- [FEATURE]: DISJOINT SET
- Backtracking HOT 1
- [FEATURE]: Data structure, Disjoint Set HOT 1
- [FEATURE]: Hash Table Data Structure HOT 1
- [FEATURE]: Adding A workflow insuring including JSDOCS on every PR HOT 3
- [OTHER]: Duplicate entry of sieve of eratosthenes HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javascript.