Skip to content

manitbaser/Competitive-Programming-Resources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

Competitive-Programming-Resources

Stuff that may help you to get started with/practice Competitive Programming

Choosing a language:

C++ makes life easier. It is the most popular language of choice for competitive programmers as it is usually faster than Java and Python, and most of the resources are available in C++( Eg. STL).

If you're entirely new to it, it would be better to get a hold the basic syntax of C++. https://www.tutorialspoint.com/cplusplus/index.htm is a good way to go about learning it.

The next thing one ought to learn is about time and space complexities. The videos in this link should be enough: https://www.interviewbit.com/courses/programming/topics/time-complexity/

Learning a few sorting and searching algorithms helps in getting a good hold of these concepts( https://www.geeksforgeeks.org/sorting-algorithms/). The main sorting algorithms one should know about are Selection, Bubble, Insertion, Quick, Merge and Bucket( though reading about Heap and Pigeonhole won't do any harm).

For different data structures, GeeksforGeeks articles are a lot helpful. I have tried to cover all of them here:-

  1. Arrays: https://www.geeksforgeeks.org/arrays-in-c-cpp/
  2. Vectors: https://www.geeksforgeeks.org/vector-in-cpp-stl/
  3. Stacks: https://www.geeksforgeeks.org/stack-data-structure/
  4. Queues: https://www.geeksforgeeks.org/queue-data-structure/
  5. Deque: https://www.geeksforgeeks.org/deque-set-1-introduction-applications/
  6. Linked list: https://www.geeksforgeeks.org/data-structures/linked-list/
  7. Doubly linked list: https://www.geeksforgeeks.org/doubly-linked-list/
  8. Trees: https://www.geeksforgeeks.org/binary-tree-data-structure/
  9. Graphs: https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/
  10. Trie( hardly came in my use): https://www.geeksforgeeks.org/trie-insert-and-search/
  11. Ordered_maps/maps: https://www.geeksforgeeks.org/map-associative-containers-the-c-standard-template-library-stl/
  12. Unordered_maps/hashmaps/dictionary: https://www.geeksforgeeks.org/unordered_map-in-cpp-stl/
  13. Ordered set/set: https://www.geeksforgeeks.org/set-in-cpp-stl/
  14. Unordered set/hashset: https://www.geeksforgeeks.org/unordered_set-in-cpp-stl/
  15. Priority_queue/heaps( min/max): https://www.geeksforgeeks.org/priority-queue-in-cpp-stl/

Next thing should be to get a hold of programming in C++. HackerRank is an excellent platform to do so( https://www.hackerrank.com). The interface is friendly, and solving fundamental problems will give you a gist of what comes next.

After programming on HackerRank for a week or so, one should get started with topic wise questions from either LeetCode or InterviewBit. The interface of either site is fantastic. InterviewBit gives more of a structured approach for CP practise, while the LeetCode community is incredible. Even after solving a problem, one should look at the most liked solutions in the comment section of LeetCode and see how others may have used a more optimized approach. One can opt to solve the LeetCode’s top interview questions (https://leetcode.com/explore/featured/card/top-interview-questions-easy/) if the interviews are not so far away.

Some resources for specific topics:

Dynamic Programming: https://www.geeksforgeeks.org/top-20-dynamic-programming-interview-questions/ The videos are beneficial for these set of problems, and this ought to help you to get a good hold of Dynamic Programming.

Graphs: A few algorithms which come in handy:

  1. Prim's Algorithm for Minimum Spanning Tree
  2. Kruskal's Algorithm for Minimum Spanning Tree
  3. Depth First Search
  4. Breadth First Search
  5. Detect Cycle in a Directed Graph
  6. Kosaraju's Algorithm for Strongly Connected Components
  7. Dijkstra's Algorithm for finding the Shortest Path
  8. Bellman Ford
  9. Topological Sort for Directed Acyclic Graph
  10. Floyd Warshall Algorithm for all pair Shortest Path
  11. Finding bridges in a graph: https://www.geeksforgeeks.org/bridge-in-a-graph/

Revising for upcoming interviews:

  1. When the interviews are only a month away (would recommend revising from here): https://docs.google.com/document/u/1/d/1SM92efk8oDl8nyVw8NHPnbGexTS9W-1gmTEYfEurLWQ/mobilebasic
  2. Going through the problems on GeeksforGeeks Archives is a must. By doing this, one gets a pretty good idea which type of questions to expect and what topic to revise further. Also, I have observed that questions often( couldn't emphasize more) repeat and you're in luck if you already know the approach/solution. :P

If you still feel like further practise or temperament building is required, one should go for the contests on CodeChef or Codeforces. This will definitely help one to work on his/her speed and accuracy. After all, practice makes perfect. :)

Feel free to reach out to me @manitb06@gmail.com!