This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services. You consent to our cookies if you continue to use our website. Read all about our Privacy Policy / GDPR here.

I agree

What are algorithms?

You can think of an algorithm as a recipe that describes the exact steps needed to solve a problem or reach a goal. A programming algorithm describes how to do something and the computer will do it exactly that way every time. But first you have to convert the algorithm into a language the computer will understand, like the programming languages c++ or python.

In the design process we can write an algorithm as a list of steps using text or as a picture with shapes and arrows called a flowchart.

An algorithm is not the computer code. Algorithms are just the instructions which gives a clear idea how to write the computer code.

Example

This is an example to write an algorithm which finds the fibonacci series till terms <= 50

Step 1: Start
Step 2: Declare variables terms, arr
Step 3: Initialize variables terms = 50, arr[terms]
Step 4: Repeat the steps until i <= terms
  Step 4.1: If i > 2
  Step 4.1.1 arr[i] <- arr[i - 1] + arr[i - 2]
  Step 4.2: Else
  Step 4.2.1: arr[i] <- 1
  Step 5: Display arr[i]
Step 6: Stop

The C++ code for this algorithm would look like this

#include <iostream>
int main(int argc, char** argv){
    int terms = 50;
    long arr[terms];
    for ( int i = 1; i <= terms; i++ ) {
        arr[i] = ( i > 2 ? ( arr[ i - 1 ] + arr[ i - 2 ] ) : 1 );
        std::cout << arr[i] << std::endl;
    }
    return EXIT_SUCCESS;
}

What is tea?

Tea is an aromatic beverage commonly prepared by pouring hot or boiling water over cured leaves of the Camellia sinensis (scientific name), an evergreen bush native to East Asia. After water, it is the most widely consumed drink in the world. (wikipedia)

fresh green tea with min picture
fresh green tea with mint

An often surprising fact to tea novices is that all teas (Black, green, Oolong, White and Pu’erh) come from the same plant. The tea plant grows best in loose, deep soil, at high altitudes, and in sub-tropical climates. So, in short, “tea” is anything derived from the Camellia sinensis plant.

I drink green and black tea every day. Especially when I am using a code editor or when I have to create efficient algorithms.

Let’s get in contact and drink a cup of tea together!

Arne
Algorithmic Adventurer