You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Dynamic Programming: Longest CommonSubsequence, Longest Increasing Subsequence,Edit Distance, 0/1 Knapsack, Coin Change,Matrix Chain Multiplication, Max Interval Sum
Graph Traversal: Flood Fill, Floyd Warshal,MST, Max Bipartite Matching, Network Flow,Articulation Point
“For me, great algorithms are the poetry ofcomputation. Just like verse, they can be terse,allusive, dense, and even mysterious.But once unlocked, they cast a brilliant newlight on some aspect of computing.”— Francis Sullivan
“An algorithm must be seen to be believed.”— Donald Knuth
“I will, in fact, claim that the differencebetween a bad programmer and a good one iswhether he considers his code or his datastructures more important.Bad programmers worry about the code.Good programmers worry about data structures andtheir relationships.” — Linus Torvalds
“Algorithms + Data Structures = Programs.”— Niklaus Wirth`
How to become good at code challenges?
Observe, Introspect, Retrospect, Refactor, Repeat
Understand The Basics
Don't skip basics, mathematics, data structuresand algorithms. Mathematics helps build a solution.The data structures are the tools and the algorithmsare the techniques that are the arsenal that everygood programmer must have, more the better. Else,you will only seea hammer and a nail.
Know The Process
To solve the challenge, start with trivial, slowideas to form a heuristic technique, and thenimprove towards creative, fast algorithms whichcould be solved with specific techniques. So justsolve as you can first even the exponential solutionif it works it's fine, be grateful.
Start by solving easy problems, then medium, andfinally the difficult ones. Try different typesof problems from different sources.
Learn from other's solution and compare with yourown. Try to understand what other did differentlyand analyse what can be improved, both in yoursolutions. This will help add moredimensions to problem analysis and solutions ideas.
Improve your understanding by trying to answerWhy was it done this way?.
Estimate The Complexity
The time limit set for online tests is usuallyfrom 1 to 10 seconds. We can therefore estimatethe expected complexity. During contests, we areoften given a limit on the size of data, andtherefore we can guess the time complexity withinwhich the task should be solved. This is usuallya great convenience because we can look for asolution that works in a specific complexity insteadof worrying about a faster solution.
For example, if:
n <= 1 000 000, the expected time complexity is O(n) or O(nlogn)
n <= 10 000, the expected time complexity is O(n^2)
n <= 500, the expected time complexity is O(n^3)
Of course, these limits are not precise. They arejust approximations, and will vary depending on thespecific task.
Folders
resource folder contains learning materials.
About
Code Challenge Solutions from different sources in Java by@anitsh