Algorithms and Data Structures implemented in JavaScript for beginners, following best practices.
GNU General Public License v3.0
24888
575
4305

Description

tarverseDFS function is not working

Expected Behavior

tarverseDFS function should traverse the tree

Actual Behavior

In tarverseDFS function , the res array ia empty or undefined

Steps to reproduce (if applicable)

No response

Additional information

No response

Motivation

Currently no stack folder, will be great how to do questions where stack is used

Examples

No response

Possible workarounds

No response

Additional information

No response

We have now successfully added guidelines for importing and using algorithms in this repository, inside other algorithms. This has been done to reduce code repetition and uphold code quality. Some functions do implement their own versions of data structures and helper functions, as previously, algorithms were supposed to be completely self contained. This issue initiates a search and fix so that all functions and data structures which can be imported in an algorithm should be imported.

Also as an addition to the topic, this initiative should also weed out bad code, i.e.:

  • Code which does not follow the contributing guidelines.
  • Code with a bad implementation.
  • Bad Code in general.
  • Complicated operations without comments.

Description

The DIRECTORY.md workflow isn't committing/pushing any needed changes due to the master branch being protected.
Currently, there's no way to make GitHub Actions have access to a protected branch.

Our current options are:

  • Disable branch protection (not recommended).
  • Commit as someone with access to making direct commits to the branch.
  • Wait until GitHub provides a solution to this.

Two issues found with the Validate Url algorithm:

  1. A string is considered to be valid URL if it starts with www. even though it does not have https
  • validateUrl('www.google.com') // returns true
  • validateUrl('google.com') // returns false
  1. A valid URL returns false if starts with www like:
  • validateUrl('https://wwwdomain.com') // returns false

Add: Kosaraju's Algorithm to find strongly connected components in a directed graph.

I just stumbled upon this gem while executing the tests locally and then wondering what's going on.

See https://github.com/TheAlgorithms/JavaScript/actions/runs/3255189818/jobs/5344248296#step:5:161

@raklaptudirm what do you think? Should we

  1. disable the test so it's skipped and doesn't clog up our CI
  2. figure out why this immense delay happens, fix the test (or the implementation) and re-enable the test once we're good

Implementation of Binary Insertion Sort

The dependencies are somewhat outdated and have seen quite a bit of wild growth :)

This causes npm install to fail on M1 Macs running Node 16 (at the moment)

DateToDay("1/1/2020") returns "Friday" but its "Wednesday". Other basic tests show the wrong day as well.

file is at Recursive/test/palindrome.test.js

This is a famous Interview question and I would like to contribute the algorithm for this.

The Project-Euler doesn't have the following questions:

  • Q7, Q11, Q13, Q17, Q19, Q21, Q22, Q24.

  • Add them to complete the order till Q25.

Adding an alternative to selection sort using another method for swapping elements in an array

Missing Brian Kernighan's algorithm for counting set bits in the binary equivalent of a number, i.e. the number of 1 in the binary form of a number.

Implementation of CycleDetection.js seems inappropriate.

  • Weird function name main() and its invocation can cause the program to crash.
  • Tests are missing.
  • Not exported, Hence not resuable.
  • Can be optimized further (Optional)

Hi,

I have not seen any implementation of Möbius function in this repo.
Could you please assign this issue to me?

Regards,
Akshay