Category Archives: Algorithm

Asymptotic Notations

Here you will learn about Asymptotic Analysis and Asymptotic Notations in detail. It is common that we write Algorithm before writing code to any problem. There may exist more than one solution for a particular problem. But we need the solution which is better in time and space complexities. To compare and analyse algorithms complexities… Read More »

Dining Philosophers Problem in C and C++

In this tutorial you will learn about Dining Philosophers Problem in C and C++ with program example. What is Dining Philosophers Problem? There are some Philosophers whose work is just thinking and eating. Let there are 5 (for example) philosophers. They sat at a round table for dinner. To complete dinner each must need two Forks (spoons).… Read More »

Bellman-Ford Algorithm in C and C++

Here you will learn about Bellman-Ford Algorithm in C and C++. Dijkstra and Bellman-Ford Algorithms used to find out single source shortest paths. i.e. there is a source node, from that node we have to find shortest distance to every other node. Dijkstra algorithm fails when graph has negative weight cycle. But Bellman-Ford Algorithm won’t fail… Read More »

Matrix Chain Multiplication in C and C++

Here you will learn about Matrix Chain Multiplication with example and also get a program that implements matrix chain multiplication in C and C++. Before going to main problem first remember some basis. We know that, to multiply two matrices it is condition that, number of columns in first matrix should be equal to number of… Read More »

Travelling Salesman Problem in C and C++

Here you will learn about Travelling Salesman Problem (TSP) with example and also get a program that implements Travelling Salesman Problem in C and C++. Let say there are some villages (1, 2, 3, 4, 5). To work with worst case let assume each villages connected with every other villages. And there is a Salesman living… Read More »

Analysis of Algorithms

In this tutorial you will learn about analysis of algorithms. Before learning analysis of algorithms lets quickly take a look on what is an algorithm and why we require it. What is an Algorithm? An algorithm is the step by step unambiguous procedure to solve a given problem. For example steps for making Tea or… Read More »

Sliding Window Protocol Program in C and C++

Here you will get sliding window protocol program in C. In computer networks sliding window protocol is a method to transmit data on a network. Sliding window protocol is applied on the Data Link Layer of OSI model. At data link layer data is in the form of frames. In Networking, Window simply means a… Read More »

Bisection Method in C and C++

In this tutorial you will get program for bisection method in C and C++. To find a root very accurately Bisection Method is used in Mathematics. Bisection method algorithm is very easy to program and it always converges which means it always finds root. Bisection Method repeatedly bisects an interval and then selects a subinterval… Read More »

RSA Algorithm in C and C++ (Encryption and Decryption)

Here you will learn about RSA algorithm in C and C++. RSA Algorithm is used to encrypt and decrypt data in modern computer systems and other electronic devices. RSA algorithm is an asymmetric cryptographic algorithm as it creates 2 different keys for the purpose of encryption and decryption. It is public key cryptography as one… Read More »

Difference between Preemptive and Non-Preemptive Scheduling in OS

Here you will learn about difference between preemptive and non-preemptive scheduling in os. Preemptive Scheduling Preemptive Scheduling means once a process started its execution, the currently running process can be paused for a short period of time to handle some other process of higher priority, it means we can preempt the control of CPU from… Read More »

Hamming Code in C and C++

Here you will get program for hamming code in C and C++. Hamming code is a popular error detection and error correction method in data communication. Hamming code can only detect 2 bit error and correct a single bit error which means it is unable to correct burst errors if may occur while transmission of… Read More »

Hill Cipher in C and C++ (Encryption and Decryption)

Here you get encryption and decryption program for hill cipher in C and C++. What is Hill Cipher? In cryptography (field related to encryption-decryption) hill cipher is a polygraphic cipher based on linear algebra. Invented by Lester S. Hill in 1929 and thus got it’s name. It was the first cipher that was able to… Read More »