Skip to content

Latest commit

 

History

History
94 lines (81 loc) · 6.92 KB

competitive.md

File metadata and controls

94 lines (81 loc) · 6.92 KB

Competitive Programming and DSA

Resources for Competitive Programming (2019-20)

Before you proceed with the resources, make sure you have an intermediate knowledge of any programming language of your choice. If you are starting with a language, I would recommend learning C++. CodeChef DSA Certification Foundation is a good resource to prepare for competitive programming. It has theory as well as problems you can do topic-wise.

Those who are interested in preparing from MOOCs can refer to these:

  1. Algorithms, Part I; Coursera
  2. Algorithms, Part II; Coursera

For people interested in the theoretical aspects of competitive programming/DSA:

  1. MIT OCW 6.006 Introduction to Algorithms, Fall 2011 - YouTube Playlist
  2. MIT 6.046J Design and Analysis of Algorithms, Spring 2015 - Youtube PLaylist
  • Project Euler is a good site to practice problems that are more math oriented.

If reading books is your style:

  1. The Algorithm Design Manual (TADM) by Skiena is a super beautiful book for absolute beginners.
  2. Competitive Programming 3: The New Lower Bound of Programming Contests by Felix Halim and Steven Halim
  3. Competitive Programmer's Handbook: A free and extensive book by Antti Laaksonen

For practicing problems, you can visit any popular website like Codechef, Codeforces, SPOJ.

A very important note: To excel in competitive programming you need to practice lots of problems and participate in competitions regularly. Do not get demotivated by the rank you get in these competitions. Your rank will improve with time. Competitive programming can be intimidating when you start off but it will get easier with deliberate practice (What is deliberate practice?). When you have a 2 week vacation, you should participate in at least 2-3 competitions.

How to start? (For absolute beginners):

  • Pick your IDE! For Linux users, you can use your favorite text editor along with the terminal. Windows users can use Code::Blocks, VScode, etc. There are few online IDEs as well if you don't want to spend time setting up your environment. ideone.com and Codechef's IDE are the more popular ones.
  • Pick your programming language! No language is better, it is only your prowess with it that will determine your performance. Even if you are unsure, continue with C for now. You will eventually figure out C++ very smoothly.
  • Learning Articles
  • Here you will find loads of simple problems for getting started. With very few pre-requisites in terms of data structures, you will find it easy to solve a few problems and learn how to submit code. Pick 20 problems randomly and start solving. If you think it is getting repetitive, you can move on to the next step.

(For moderately experienced coders):

  • Codechef's certification programme is a beautiful resource! Explore the syllabus and tackle each topic one at a time. PS: the foundation and advanced section should be sufficient for most of the problems expected in tests for internships.
  • Take part in contests! You can try Codeforces for starts. This is the best incentive to continue learning CP. Take part and find out for yourself! Codechef and Codeforces feature some really competitive contests with quality questions.
  • GeeksForGeeks Blogs! While few of you are here for the incoming internship tests, GFG has written decent blogs targeted for people going for such tests. They have pointed out the popularly asked Algos and DSs. Pick a topic from the codechef article above, learn about it on GFG. Simple, right? Explore for yourselves!

(For advanced topics):

Right approach to problem solving:

Following these steps will take you a long way in the learning process.

  • After you submit your code, ALWAYS check at least two other correct codes by other users (if not more!). You will learn new techniques and different coding styles from users all over. THIS IS A MUST.
  • UPSOLVE THE CONTEST! Telling from personal experience, this is one of the most efficient ways for a steeper learning curve. Solve all problems even after the contest is over. If you cannot, try to get a hint by reading first few line of editorial. If you cannot solve even after that, just read the editorial and code the solution yourself before reading the implementation. Sometimes the idea in the editorial seems very trivial to understand, so we have tendency to just skip the implementation. Don't do that. Code it yourself and get that AC.
  • Never run from topics you are uncomfortable with. (Well, this kind of goes without saying.)

Learning Resources

  • CP-Algorithms: A blog with efficiently written C++ code for most data structures and algorithms.
  • A2OJ Ladders: List of Good Problems for every rating level on CodeForces.
  • Algorithms Live: Detailed video explanation for different algorithms.
  • Algorithms Thread: Another good YouTube video series from one of the red coder on CF
  • USASCO Guide: A detailed syllabus prepared by Benq. It is still in Beta phase but pretty good
  • CSES Problem Set: List of 200 standard problems of varied difficulty
  • Junior Training Sheet: Alternative for A2OJ ladders
  • kactl: KTH Algorithm Competition Template Library