Basically, as the title says, I need advice on how do I progress further in competitive coding. It feels as if I have reached some dead end.
Problems-
1.Dynamic Programming
It is something, as I have seen, indispensable when you in competitive coding. I tried to learn it, I read the codechef tutorial (here) and the topcoder tutorial (here) and I am able to successfully identify the conditions/questions where this dynamic programming has to be applied. But I am stuck in the very next step, how to implement it? Either my solutions go all wrong, or are pseudo brute force. I tried to find some easy Q to solve, but am repetitively getting WA (no Correct Answer till now )
So, I wanna know if-
- Anybody knows reaaaalllly novice Q on dynamic programming? I think I need to work it up from scratch, and once I get the momentum, I should be able to do fine.
- What approach did you guys use to tackle dynamic programming? Would you advise me any improvements in my approach (I basically learn by tutorials and then problem solving. )
- How do you know that, like, âYes! NOW I am perfect in Dynamic Programming.â. Allow me to cite an illustration to explain myself-
If I get a Q now, to find sum of natural numbers till N using a for loop, I am like âYeah, easy. Set loop from I=1 to n and add value of Iâ
So, are you guys also like this when dealing with dynamic programming Q? As in âYeah! Simple. Just make a 2-D array, go on iterating âŚthisâŚand thatâŚand done.â Meaning, does dynamic programming seem really very easy when you people have finished it?
2.Graph Theory
It is a very unexplored area for me. I thought of dealing with it after I finish with Dynamic Programming. (My method is reading the book âAlgorithmic Graph Theory and Sageâ , and tutorials at topcoder here along with the book âIntroduction to Algorithmâ.)
Havent touched it yet, but it seems 10x tougher than dynamic programming by looks. My question here-
- Any tips for me on how I should start/approach this?
- Any language I should change/adopt. I currently use C. I know a little bit of Java too, and am learning python (from scratch- know basic input output only atm). My friends suggested me to switch to C++ for graph theory, so I want to know your opinions. Does graph theoryâs easiness depend on language and is tough in C? And in case I should switch to C++, anywhere I can learn the language well? (The only thing I have is Hackerrank Problems on C++ which aim at teaching input output and various features. [link is here )
3.Permutations
This thing is a monster for me. I rally donât know why, but whenever I see a Q on lines âPrint the number of arrangements possible modulo 10^9+7â , my mind just blanks out. I cant even think of a brute force approach! I mean, how am I to do this?
Please have a look at the question here . It asked to print the number of arrangements possible module 10^9 +7. But, I literally blacked out that âHow am I supposed to do it?â I am unable to advance after taking the inputs. And I got no idea how to prepare for these type of Questions. Any help would be appreciated !!
(PS: I tried my best to make the Q clear and informative. I referred to all related questions asked on these topics, especially Dynamic Programming, and decided to ask my question after that. I see many other people struggling with it too, and hence Links etc. were added so that anyone struggling with the topics can also refer.)