Recent Posts

How to improve logic building in programming?

9 steps to improve logic building in programming

We use to get stuck while solving any programming problem, mostly when we are in
the starting phase of coding. The reason behind facing that difficulty in solving the
question can be due to many reasons, like unable to solve the question as per constraints,
or the time limit gets exceed, or maybe not getting any approach to solve.

The complexity can be many by words, but in reality, it could be due to a weak base of
logical understanding. Let's see another case; we read the question, see the constraints,
see the input/output format, see the sample input/output provided, and start coding.
Eventually, it passes the given test cases, but after submission, it gives the wrong answer.
Why so? This is because in many cases brute force won't help.

These types of circumstances give rise to an idea or the need to improve logic building
in programming
. With a good logic building skill, you can master and shine in any
Competitive Coding Contest. So, here are some steps that contribute to an effective
logic formation to solve any programming question.

1. Choose a programming language
    This is a segment that could affect your learning. As a beginner, people use to follow
    inessential things. When you see someone coding in Python or when you see the
    codes in Python, you think, "It is so easy to write code in this language, let's
    master this, and I'll rock." Or if you find any YouTube tutorial too easy or
    with good guidance you start following it, irrespective of which language, they
    are guiding you with. For a beginner point of view, it is recommended to start
    with C or C++, and after that you can choose any language which makes you
    feel comfortable, but recommendation will be C++ or Java, as they are widely
    spread for OOPs.

2. Go through the books at least once
    Many coders start coding directly via seeing the codes in YouTube videos or via
    copying code from any website like GFG, StackOverflow,
ATC, etc.
    These platforms are to help you with your learning, when you stuck, then
    seek for help on the these platforms.
    We recommend you first read any programming language theoretically,
    then move to the coding segment.
 
3. Practice before participating
    Once you are done with the book, you should practice different types of problems.
    A good practice is to visit any Competitive Programming platform and then practice
    the unrated questions there. When you find yourself compatible with those types of
    questions, only then you should start participating in the rated contests there.

4. After every competition, try to check others submissions
    It is a healthy practice to see the different approaches to a single problem. That's
    why it is recommended, after ending the contests, you should check others'
    submissions so that you know the more efficient way to solve that particular
    question. And, if you found that you are the one whose solution is most optimized,
    then very well keep it up! You are doing great with your codes.

5. Your note is your weapon
    You should make notes for the programming language that you follow. This will
    help you in various ways, especially when you are preparing for your placements.
    You should note down the problems together with their solution, which you find
    very logical or complex. Also, you may find questions that are exactly based on a
    problem from your note. Moreover, making notes help you to understand things better.

6. Make a mini group
    Ask 1 or 2 of your friends to pair up with you for the competitive competitions.
    There might happen that you won't get logic for a problem. In those circumstances,
    your mini-group will be an effective aid for you. It is recommended to make the group
    mini because adding more people increases the probability of being distracted from
    your path. So, you should never form a group of more than 3 people.

7. Avoid being stuck
    If you get stuck on any problem, it is a good practice to skip that question for later.
    And till then, solving other problems. After dealing with all the questions, you should
    come back to the question that you skipped. If you can solve that, then only give it a
    try, else try making a pseudo code, implement an algorithm. Dry run your code
    before you submit it. If passes, test it for other test cases as well. While doing so,
    you can also seek help from Google in modifying your algorithm.

8. Pseudo code is compulsory
    Each time either you are just practicing or solving rated questions, thinking of the
    logic and building a pseudo algorithm/code before coding is essential. This will
    contribute a lot to enhancing your logic-building skills.
 
9. Never get retirement
   
Coding is all about practicing. The most vital requirement is to keep practicing every day.
    The more practice you do, the more skill you will acquire. There is a lot of platforms, like
    CodeForces, InterviewBit, HackerEarth, etc., that will help you to practice. You can
    do practice on the Competitive Platform that you follow itself. Every platform that
    organizes competitive coding competition also provides a segment where coders can
    do practice for the contests.
How to improve logic building in programming? How to improve logic building in programming? Reviewed by ATC Tech Adda on April 27, 2021 Rating: 5

No comments:

Powered by Blogger.