Hacker News new | ask | show | jobs
by santiagobasulto 2825 days ago
This looks like a nice effort and is appreciated, but be aware that the quality of the python is REALLY bad. Don't follow these standards if you're looking at these algorithms. For example, in Quickselect, I saw this:

  pivot = random.randint(0, len(list) - 1)
  pivot = list[pivot]

which is bad at every possible level. First, it can be a one liner with `pivot = random.choice(list)`, but also, reusing the same variable over and over again is discouraged.

Again, congrats to the team that put this together for free and with probably the best intentions. But if you're using it, be aware that the code might be worth a refactor.