Home Theory
Category:

Theory

View theory topics

  • Theory

    What is the Big O notation? [Simplified]

    by nikoo28
    14 minutes read

    As soon as you hear the word ‘Big O’, does your mind go “Oh my god! Oh no! This again?” The next thing following it would be time complexity and what not. Suddenly, your brain starts getting this confusing signals and you lose track of what is happening. If you have felt this at some point of time while learning programming, then I want to tell you that you are not alone. In fact, you are proceeding in the right direction. But all these notations can start to get overwhelming …

    0 FacebookTwitterLinkedinWhatsappEmail
  • Theory

    Algorithmic Paradigms – Recursion

    by nikoo28
    10 minutes read

    The first thing that comes to our mind on hearing the word recursion is doing a thing over and over again. But how can you expect to achieve a solution to a problem by repeating the same thing over and over again. In this post we would be understanding exactly that. Algorithmic paradigms are a way to solve a problem, and recursion is one of them. Some of the other ways are: Brute Force Divide and Conquer Greedy Dynamic Programming So, what is Recursion? Sometimes a good image helps to …

    1 FacebookTwitterLinkedinWhatsappEmail
  • Theory

    What is the Time Complexity of an Algorithm?

    by nikoo28
    7 minutes read

    Time complexity is an important criteria when determining the quality of an algorithm. An algorithm is better if it produces the same result in a less time for the same input test cases. However, one must take care of the type of input data used. Some input data can give you false positives. Let us take an example to understand this better. You have an algorithm that is sorts a list of numbers. If the input data you provide to this algorithm is already sorted. Then this algorithm gives you …

    0 FacebookTwitterLinkedinWhatsappEmail
  • Theory

    Course on Algorithmic Paradigms

    by nikoo28
    5 minutes read

    Algorithmic Paradigms in short define how you can go about solving a problem. If you are starting to solve problems in computer science, this course is designed for you. However, this course is also recommended for you if you are revising all the basics and want a quick recap of some famous techniques. What are Algorithmic Paradigms? Whenever you try to build something, or develop something, an initial research and foundation is very essential. Think about it, a skyscraper will only be as stable as its base. In the world …

    0 FacebookTwitterLinkedinWhatsappEmail
  • Dynamic programming always reminds of a favorite quotation: Of the several different ways to solve a problem, dynamic programming is a paradigm where we tend to solve the problem as we move ahead and keep on learning. This is one of the techniques which even seasoned programmers find hard to implement. In this post we will try to address some of these fears and aim to have a better understanding of this approach. If you are new to problem solving and somehow landed at this post, it is recommended to …

    0 FacebookTwitterLinkedinWhatsappEmail
  • Theory

    How do you compare two algorithms?

    by nikoo28
    15 minutes read

    We compare things all the time to determine which one is better over the other. The best example is when you are buying stuff online, we compare prices across websites, two different mobile phones, or even two different outfits. We know that there are different techniques of solving a problem in computer science: Brute Force Divide and Conquer Greedy Dynamic Programming Naturally, when we try to solve a problem with different methods, one would want to compare them. Once they are put side to side, we can then analyze which …

    0 FacebookTwitterLinkedinWhatsappEmail
  • Greedy algorithms is a paradigm that describes the approach on how you can go about solving a problem. You might have heard about a lot of algorithmic techniques while learning how to solve problems in computer science. The others being: Brute Force Divide and Conquer Dynamic Programming In this post we shall understand what a greedy algorithm is and how can it be used to solve problems which don’t seem very trivial at the first glance. What is a Greedy Algorithm? What is the first thing that comes to your …

    0 FacebookTwitterLinkedinWhatsappEmail
  • Theory

    Algorithmic Paradigms – Brute Force

    by nikoo28
    9 minutes read

    Brute force method would probably be the favorite algorithmic paradigm of every developer. The beauty of a brute force method is that it is pretty straightforward and if a solution to a problem exists, you are guaranteed to find it. This option is also the most exhaustive option as we might go through all the possibilities before arriving at the result. What is Brute Force Method? You might have heard the phrase “Brute force method to solve the problem”. What exactly do you mean by that? It simply means that …

    0 FacebookTwitterLinkedinWhatsappEmail
  • What comes to your mind when you think about divide and conquer? Do you think about wars? A strategy? A way you can split up your forces and then conquer the enemy? I am here to tell you that is exactly right. Luckily, in computer science you don’t have to deal with weapons and artillery. There are several ways to approach a problem. Divide and conquer is one of them. In our case a problem statement is our enemy. We need to break it into parts (divide) and then solve …

    0 FacebookTwitterLinkedinWhatsappEmail
  • Question: Given an integer N, find all the prime factors of the number. Input: N = 45 Output: 3 5 Finding prime factors of any numbers is a very important concept in number theory. One sample problem is available here in which we have to find the largest prime factor. The mathematical concept behind this problem is simple. We start with ‘2’ and keep dividing the original number to get rid of composite factors. Continue this process until the number is no longer divisible by 2. This means that at …

    0 FacebookTwitterLinkedinWhatsappEmail

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More