Giter VIP home page Giter VIP logo

thealgorithms / javascript Goto Github PK

View Code? Open in Web Editor NEW
31.3K 31.3K 5.4K 2.89 MB

Algorithms and Data Structures implemented in JavaScript for beginners, following best practices.

Home Page: https://the-algorithms.com/language/javascript

License: GNU General Public License v3.0

JavaScript 99.97% Shell 0.01% TypeScript 0.02%
algorithm algorithm-challenges algorithms algorithms-implemented cipher conversions cryptography data-structures hacktoberfest javascript mathematics search sort sorting-algorithms

javascript's Introduction

The Algorithms - JavaScript

JavaScript Repository of TheAlgorithms, which implements various algorithms and data structures in JavaScript.

JavaScript Banner

Gitpod ready-to-code Checks codecov Contributions Welcome standard.js Discord chat


These implementations are for demonstrative purposes only. Dedicated implementations of these algorithms and data structures are much better for performance and security reasons. We also do not provide any guarantee for api stability.


Before contributing to this repository, make sure to read our Contribution Guidelines. You can look at other TheAlgorithms Repositories or the issues with a "help wanted" label for inspiration regarding what to implement. Our maintainers will guide you through how to make your contribution properly if you make any mistakes. The names of the maintainers of this repository are listed in the CODEOWNERS file.

You can find a list of the algorithms currently in the repository in the directory. Explanations of many of the algorithms can be found in the wiki.


Thanks to all the contributors ❤️

javascript's People

Contributors

abhinavxt avatar algobytewise avatar ankush263 avatar anupkumarpanwar avatar appgurueu avatar cclauss avatar charliejmoore avatar chiranjeev-thapliyal avatar christianbender avatar defaude avatar dependabot[bot] avatar fahimfaisaal avatar itsvinayak avatar josecarlosweb avatar leeyan44 avatar lvlte avatar mandy8055 avatar marsonya avatar masa-shin avatar ms10398 avatar pomkarnath98 avatar rahul1995 avatar raklaptudirm avatar rodigu avatar ruppysuppy avatar suryapratapsinghsuryavanshi avatar vil02 avatar waddah-jd avatar winsonrich avatar yatin-kathuria 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  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

javascript's Issues

Build DIRECTORY.md with JavaScript, not Python

We present all of of our algorithms in an organized list, DIRECTORY.md so visitors can rapidly find topics of interest. Currently DIRECTORY.md is being autogenerated by one of our GitHub Actions which uses Python code to create the directory text.

Why should the JavaScript repo rely on Python code?!? Especially given that GitHub Actions fully support the creation of JavaScript-based Actions. Can we use JavaScript to autogenerate DIRECTORY.md and lose the Python code in the process?

Split READMEs for each folder.

instead of keeping one solitary readme I the root folder, it would be better to add separate README to each folder.
what this would achieve would be that for someone interested in ciphers should open the folder and find details in the README specific to ciphers only.
This seems like an easy process of splitting the README into separate duplicates and then adding them to individual folders, I would really love it if I can work on this. 🥇 😃

Algorithm needed for graphs data structures

some algorithms 🥇

  • Add Kruskal's Algorithm to find Minimum Spanning Tree
  • Algorithm to find the Minimum Spanning Tree using Prims Algorithm #227
  • Algorithm to find connected components using Disjoint sets
  • Algorithm to find connected components in the graph using depth-first search #223
  • Depth First Search Algorithms #199

feel free to add more algorithms in the list
thank you, @itsvinayak

Feature: Adding Introsort implementation in JS.

We can add the sort routine used by std::sort in c++ standard library in JavaScript.
Introsort is a hybrid sorting algorithm that uses quicksort and heapsort. The C++ STL takes it a step further and adds insertion sort to it for small length arrays.
We can add a method is JS for introsort which takes array and a compare function as parameters and sorts the array.

An improvement on Ficbonacci function using DP

// My code just improves a little
// Feel free to ask me questions

function dp_ficbo(n)
{
var val = [];
for ( let i = 0; i <= n; i++)
{
val[i] = 0;
}

	if ( n == 1 || n == 2)
	{
		return 1;
	}
	else
	{
		val[1] = 1;
		val[2] = 2;

		for ( let i = 3; i <= n; i++ )
		{
			val[i] = val[i - 1] + val[i - 2];
		}
	}

	return val[n - 1];
}

console.log(dp_ficbo(20));

Addition of .gitignore file

Add .gitignore file to ignore the addition of node modules and other unwanted files in the commits.

If a memeber views this, please add good first issue and difficulty: easy labels

Typescript version?

These algorithm implementations are very helpful. But they could be shorter and easier to understand with Typescript, using Typescript features. Many people use Typescript instead of directly Javascript now. How about converting these algorithms to Typescript?

JavaScript

For extra learning reference material

Files that are not compliant with standardjs

The following FilePaths fail npx standard FilePath and can not be fixed using the --fix option.


  • Javascript/Ciphers/keyFinder.js #140
  • Javascript/Ciphers/vigenereCipher.js #140
  • Javascript/Conversions/DecimalToHex.js #140
  • Javascript/Data Structures/Graph/Graph.js #141
  • Javascript/Data Structures/Heap/MinPriorityQueue.js #140
  • Javascript/Data Structures/Linked List/DoublyLinkedList.js #140
  • Javascript/Data Structures/Queue/Queue.js #140
  • Javascript/Data Structures/Stack/Stack.js #140
  • Javascript/Data Structures/Tree/Binary Search Tree.js #140
  • Javascript/Hashes/SHA256.js
  • Javascript/Search/linearSearch.js #143
  • Javascript/Sorts/TopologicalSort.js #141
  • Javascript/Sorts/bogoSort.js #150
  • Javascript/Sorts/bucketSort.js #141
  • Javascript/Sorts/combSort.js #141
  • Javascript/Sorts/cycleSort.js #141
  • Javascript/Sorts/heapSort.js #150
  • Javascript/Sorts/selectionSort.js #141
  • Javascript/Sorts/wiggleSort.js #150
  • Javascript/maths/DijkstraSmallestPath.js #147
  • Javascript/maths/abs.js #144
  • Javascript/maths/factorial.js #145
  • Javascript/maths/find_lcm.js #146
  • Javascript/maths/graph.js

TimingFunction/IntervalTimer with NodeJS

The function works fine on the browser. The instance returns the time run.
However, nodeJS uses a completely different structure for it's timers.
It may not be necessary in NodeJS. I genuinely think it helps otherwise, I use it to time my unit tests.

The value returned by setInterval() is the total runtime of the timer.

more contributors are needed

  • Adding hints and doctest to old codes
  • Reviewing Pending PRs ( fixing code format by running npm standard --fix PR labeled under "failing npm standards" )
  • Helping new Contributors
  • Add more algorithms

thank you

suggestion - allow attaching label in PR

This is suggestion to add labels such as

  • In Progress
  • Ready for Review
  • On Hold
  • Need Help
    etc...

Thanks again & once again kudos for this amazing initiative & library...

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.