TheAlgorithms / JavaScript

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

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improper and incomplete implementation of CycleDetection.js

10kartik opened this issue · comments

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)

The algorithm is complete. It has poor code quality though, as you have pointed out. Feel free to fix it.