Code Monkey home page Code Monkey logo

arrayvisualizer's Introduction

arrayvisualizer's People

Contributors

ayunami2000 avatar skeen avatar w0rthy avatar zoybean avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arrayvisualizer's Issues

Interesting research into your "disparity circle" formula along with a new, smoother one

I was chatting in my Discord with Aphitorite on GitHub, and they actually dug into your "disparity curve" formula a bit. Some interesting stuff was discovered, and we wanted to share it with you!

So first of all, we were talking about my modified version of your formula from my fork that's able to handle arbitrary array lengths, which is the following:

double len = ((ArrayVisualizer.getCurrentLength() / 2d) - Math.min(Math.min(Math.abs(i - array[i]), Math.abs(i - array[i] + ArrayVisualizer.getCurrentLength())), Math.abs(i - array[i] - ArrayVisualizer.getCurrentLength()))) / (ArrayVisualizer.getCurrentLength() / 2d);

Yeah, I know... I didn't refactor it after changing it around, and the line of code it takes up is an absolute mess. But it turns out that you had written up a partial triangle wave function (without using trig functions)!

https://cdn.discordapp.com/attachments/592103638034415647/733325936417570926/SharedScreenshot.jpg

That's why the peaks of the disparity circle visual are always jagged! You can especially see that here:

Your original formula:
https://cdn.discordapp.com/attachments/592103638034415647/733197874434932807/Screenshot_516.png

versus Aphitorite's new cosine wave formula:
https://cdn.discordapp.com/attachments/592103638034415647/733197892264656946/Screenshot_515.png

Their new cosine wave formula is as follows:

double len = (1 + Math.cos((Math.PI * (array[i] - i)) / (ArrayVisualizer.getCurrentLength() * 0.5))) * 0.5;

I personally found this super fascinating; hope this was interesting for you too!

Let ArrayController manage access counts

Update the sorting algorithms to let ArrayController manage the array access and comparison counts (aa and comps).
Currently, each sorting algorithm manually updates the comparison and access counts. By delegating access and comparison to the ArrayController (via get and compare), the counts could be managed automatically, and new statistics could be added without needing to update each sorting algorithm to implement it.

Add support for arbitrary sorting algorithms via reflection or inheritance

Allow for someone to create another file and have the program automatically recognise and add the sorting algorithm.

This could be done with an interface or abstract algorithm class, or even using carefully designed class files and reflection.

This would allow for the removal of the hard coded switch statements in main and make the code more flexible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.