Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Code Challenge Solutions from different sources in Java by@anitsh

NotificationsYou must be signed in to change notification settings

java-cheatsheet/codechallenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code challenge solutions from different sourcesin Java programming language.

Objective

I want to improve my problem-solvingand technical skills and keep mycompetitive edge by covering the coreprogramming concepts and exploringfurther.

Listed below are few topics whichhelps improve capabilities.

  • Mathematics: Prime Number, Big Integer,Permutation, Number Theory, Factorial,Fibonacci, Sequences, Modulus

  • Sorting: Bubble Sort, Quick Sort,Merge Sort, Selection Sort, Radix Sort,Bucket Sort

  • Searching: Complete Search, Brute Force,Binary Search

  • String Processing: String Matching,Pattern Matching

  • 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.


[8]ページ先頭

©2009-2025 Movatter.jp