Блог пользователя Jaserdy

Автор Jaserdy, история, 2 года назад, По-русски

I have a question for people who know a lot of algorithms. If you see a problem and understand what algorithm you need to solve this problem, can you remember this algorithm?

  • Проголосовать: нравится
  • -9
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

To your question yes, I do remember every algorithm I know, sometimes I don't remember the implementation but it is easy to remember the idea so you can implement it, but actually I've never try to memorize an algorithm by heart, I just understand it, get an intuitive idea of it, implement it and solve some problems about the algorithm. And by the way, the "algorithm implementation" is the easy part of the problem, the hard one is to recognize what should you use and do the correct observations.

  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    So, you understand the algorithm and can remember and write it?

    • »
      »
      »
      2 года назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      I remember the idea behind it, like I have a real strong intuition of why it works, with that and the time I spend to practice a new algorithm it is easy to remember the idea, some algorithms (like maximum matching for example), even though I know the idea, it would take me 20 minutes to implement it because I don't remember the implementation.

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

no :)

  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    So, how you write algorithm when you need them, but don’t remember

    • »
      »
      »
      2 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      googleforces

    • »
      »
      »
      2 года назад, # ^ |
        Проголосовать: нравится +15 Проголосовать: не нравится

      Implementing algorithms in advance and building a generic library that you can use as a drop-in during contests is helpful. But this is helpful only for complex algorithms like flows and FFT and common snippets. You should ideally be writing most simple algorithms like DFS, BFS and Dijkstra on the fly because at times it's faster than using templates, even if you're using a snippet manager, and it is a good thing to know what an algorithm does by repeatedly implementing it on your own in multiple problems before templating it.