- Learn new Maths and Physics concepts. Those may not be relevant to coding but will improve your brain.
- Solve complex Math and Physics problems, first by hand and THEN by writing codes.
- Increase the complexity of the problems with the time.
These will definitely improve your logical thinking.
I read in a study that reading everyday for 30-60 minutes will over all improve everything educationally. The better you read, the better you understand words, and the more successful you accomplish the task.That can be thanked to your reading comprehension and spelling gramar. Which code is. Sorta. A little.
Just think before solving any problem use your pen and paper if you want then go to code. If you are fascinated to read books read then it will increase your knowledge.
"Just think and solve like a programmer".
Programming is more about typing words on to a computer. You also have to think differently. You can achieve that by practicing logical mathematical problems. Yes, I know, there's some Math in them. But they can help improve your logic by a great deal.
You can find problems online, but I highly recommend Waterloo Competitions. They're great for all ages, free, and made by one of the best universities in the world for computer science.
In addition to practice problems. Try not to only memorize code, but to understand it. Understand what a computer does when it sees a points. Understand why computers handle different functions differently. Always ask, why?
In addition to asking why, try to follow up on tutorials that deal with computer programming in general, not about a specific language, but about programming as a whole. Those tutorials will cover a wide range of topic that will help you understand programming better, allowing you to make better logical decisions.
You could try to follow up on Khan Academy's tutorials on Computer Science (really great website; I'm one of their first members and they're still doing great, highly recommended):
Ways to improve logical thinking:
1. Break problems down into steps. Stop trying to get from point A to point C, and instead take the route of A-B-C. This will also help with confusion and difficulty of more complex problems.
2. Think about replacement as often as you can. EX: When dealing with money, once you reach 4 pennies, it would make more sense to replace the 4 pennies with 1 nickel, than it would be to have 5 pennies.
3. Try to apply recursion as much as possible. Before you reach 5, you must reach 4, and 3, and 2, and 1. (This ties into point 1).
Hope this helps.
Exercises and practice without consideration will just result in an incomplete understanding of a problem.
Try questioning what the concept is first. Such as, "Why does a pointer work, and why was it implemented in the first place?" Then try answering that question yourself, rather than relying on other resources. Keep doing this, and I believe your logical thinking will improve.