What are some ways to approach designing an algorithm for a new problem?

What are some ways to approach designing an algorithm for a new problem?



1. Frame your problem in terms of another, more general problem to use an already existing algorithm.

2. Start with a Brute Force application to give yourself a base. Then optimize it.

3. Divide and Conquer - a way of dealing with a large problem by breaking it down into bits and pieces and working your way up towards the solution.

Instead of seeing the whole problem as a single, huge and complex task you divide the problem in relatively smaller problems that are easier to understand and deal with.

You solve smaller problems and aggregate the solution until you are left with the solution only. At each step the problem at hand shrinks and the solution gets mature until you have the final correct solution.

Solving the smaller task and applying the same solution repetitively ( or often times recursively) to other chunks give you the result in less time.

Popular posts from this blog

After analyzing the model, your manager has informed that your regression model is suffering from multicollinearity. How would you check if he's true? Without losing any information, can you still build a better model?

Is rotation necessary in PCA? If yes, Why? What will happen if you don't rotate the components?

What does Latency mean?