Coder Social home page Coder Social logo

algorithms-js's People

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

algorithms-js's Issues

Implement Search Algorithms

Search Algorithms to be implemented are:

  • Linear Search
  • Binary Search
  • Jump Search
  • Interpolation Search
  • Exponential Search
  • Ternary Search

Package does not contain es6 modules

Description

Currently, NPM package does not contain es6 modules. Package should be shipped with the same for nodejs consumption.

Versions

  • NodeJS version (if applicable): NA
  • AlgorithmJS version: 0.0.12

Error

module.js:544
    throw err;
    ^

Error: Cannot find module './algorithms'
    at Function.Module._resolveFilename (module.js:542:15)
    at Function.Module._load (module.js:472:25)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/manrajsingh/Github/test/algo/node_modules/algorithms-js/src/index.js:1:82)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)

Expected behaviour

Seamless import

Steps to recreate

Install and require the package

Implement Sorting Algorithms

Sorting Algorithms to be implemented are:

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Count Sort
  • Heap Sort

Implement String Algorithms

String Algorithms to be implemented are:

  • KMP Pattern Search
  • Rabin-Karp Pattern Search
  • Aho-Corasick Pattern Search
  • Z-Algorithm Pattern Search
  • Levenshtein distance
  • Longest common subsequence
  • Longest common substring
  • Longest common leading/trailing substring
  • Dice's coefficient

SUGGESTION

Suggestion : we can implement a method for inserting or pushing node at specific index
###Description

In our current linked list implementation, we lack a method to insert or push a node at a specific index within the linked list structure. The addition of such a method would significantly enhance the flexibility and functionality of our linked list.

Proposed Method

The suggested method, tentatively named insertAtIndex(data, index), will take two parameters:

  • data: The data to be stored in the new node.
  • index: The index at which the node containing the provided data will be inserted.
    This method will handle the insertion of a new node at the specified index, considering edge cases such as insertion at the beginning, end, or any position within the linked list.

SUGGESTION

Description

I noticed that common algorithms related to graphs such as finding single source shortest path and multisource shortest path that are commonly used in programming paradigm are missing in the algorithms section. I would like to create a new directory named as Graph-Based-Algorithms and try to add them

Versions

  • AlgorithmJS version:

Error

Expected behaviour

Steps to recreate

Step 1 ->Creating a directory named as Graph-Based-Algorithms
Step 2-> Creating a file named as Djkstras.md which would be a readme file where I would implement the Djkstras Algorithm
Step 3-> Creating a file named as EdmondKarp.md which would be a readme file where I would implement the Edmond Karp Algorithm
Step 4 ->Creating a readme file named as readme.md where I would write and link all the aforesaid algorithms and this would be present in the directory.

People to notify

Test Coverage: Improve test coverage

Description

Currently, test coverage is at 90% which can surely be improved. Possibly, one of the easiest ways for someone to contribute to this library.

Implement Graph Algorithms

Graph Algorithms to be implemented are:

Shortest Distance

  • Bellman Ford
  • Floyd Warshall
  • Dijkstra
  • Johnson

Search

  • BFS
  • DFS

Travis Build Issue

Build is failing due to path issue which is not reproducible locally. Need to look into it.

Integrate documentation generator

Currently, there is no documentation for the code. I feel instead of normal markdown documentation, we should have a Sphinx-like documentation.

Need to explore some options.

interpolationSearch always returns -1 for array with duplicates

Description

interpolationSearch always returns -1 even if value is included in an array with duplicates. For instance, if the input is [42,42,42] and the target element is 42, the interpolation search will return -1 although 42 is included in the array.

Versions

  • NodeJS version (if applicable): 8.10.0
  • AlgorithmJS version: 0.0.13

Expected behaviour

interpolationSearch should return 0.

Steps to recreate

Input an array with all the same values in interpolationSearch, and a target element which is included in the array.

People to notify

@manrajgrover

Implement Math Algorithms

Math algorithms to be implemented are:

  • GCD
  • LCM
  • Multiplication Expo Squaring
  • Find Divisors
  • Fibonacci
  • Fisher Yates
  • Check if number is a prime
  • Calculate square root using Newton's method
  • Extended Euclid Algorithm
  • Mod Inverse
  • Mod Inverse using Fermet
  • Euler's Totient Function
  • Euler's Inverse method
  • Inverse of first 'n' numbers
  • Combination Modular

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.