Programming approach

This is a broad question, but I would like to know the opinions of experts. I came across one document Suffix arrays - a competitive approach , I also found some comments on the fact that the participant should be ready with such data structures that are already at hand. Now many days of online programming puzzles go with time. Therefore, I would like to know what other data structures / algorithms should be ready.

+6
source share
3 answers

Iโ€™ve been competing for about 10 years and have created a not-so-bad library myself. Most of the really good competitors have their own blogs, for example, the legend Pyotr Mitrichev , and there they explain the ideas that they received on some competitive issues. Reading them can help you - if you see that a good idea implements it and stores it. I add algorithms to my library when I see a problem that affects them. Thus, I can verify that my implementation is correct - I only add an algorithm if I have passed at least one problem with its implementation.

Here is a list with some of the algorithms that I have:

  • I have a huge geometric library with classes representing points, lines, polygons, segments, circles and some operations with them (for example, intersection, convex hull of many points, etc.)
  • Tarjan algorithm for highly related components
  • Dinitz flow algorithm
  • Bilateral compliance implementation
  • Optimal implementation of a minimum cost stream.
  • Aho-Corasic string search algorithm
  • Knuth-morris-pratt string search algorithm
  • Rabin-Karp string search algorithm
  • Linear suffix tree using ukonnen algorithm
  • Fast exponentiation
  • Polynomial execution
  • Big whole implementation
  • Embedding Fractional Numbers
  • Matrix class implementation
  • Primary factorization
  • Eratoshenes sieve
  • Segment tree
  • hungarian algorithm
  • 2-Sat . For this, I use the Tarjan algorithm mentioned above.

You will notice that some of the most basic algorithms (for example, BFS, DFS, Dijkstra) are not mentioned above, and this is because I did not implement them. These algorithms cannot be easily generalized in such a way that you simply copy and paste them and everything will work. It also takes me less than 5 minutes to write them - I usually add only algorithms to my library that are either hard to implement or easy to make a mistake when implementing them.

+11
source

Check out these recognized @TopCoder articles . They are really cool.

While you are on it, I suggest participating in programming contests at TopCoder. Because the best way to improve is to practice and continue to participate in such contests.

Project Euler is also exciting.

+1
source

Also, take a look at Programming Problems , this is a great link to this topic - it presents the topics necessary for success in, with the support of online .

0
source

Source: https://habr.com/ru/post/904694/


All Articles