Mistakes to avoid in an interview.

In this chapter we shall see what are the mistakes to avoid in an interview. Coming late to interview: It doesn’t matter whatever the reasons are. If you arrive late it gives an impression to recruiter that you are not serious about the job. Keeping the mobile in General Mode: Before going inside the interview […]

House Robber Problem

In this tutorial we shall solve a very famous problem “House Robber” problem. This problem can be solved by using DP method. Problem Statement: You are given an array of +ve numbers that represents amount present inside the house, you need to rob the house such that you rob maximum amount. The only condition is […]

Activity Selection Problem

In this chapter we shall learn on how to solve activity selection problem with the help of example and using greedy method. Problem Statement: You are given list of activity with starting and ending time. Your job is to find the maximum number of activities can be performed by that machine. Note that the machine can […]

Job Sequencing with deadline Problem

In this tutorial we shall learn about job sequencing with deadline problem. We shall solve this problem with the help of Greedy Approach. Problem statement: You are given a set of jobs associated with deadline and profits attached to the jobs. Your goal is to find the maximum profit within the given deadline. You have to […]

Total number of ways to get denomination of coins.

This is a variant of the previous problem. Like previous coin change problem, we shall solve with help of Dynamic Programming. Problem Statement: You are given total amount and certain coin denomination. You need to get the total number of ways you make the change. Example: Amount Value = 6 Coins = 1, 3, 6 Number […]

Minimum Coin Change Problem

In this tutorial we shall learn how to solve coin change problem with help of an example and solve it by using Dynamic Programming. Problem Statement: You are given a certain coin denomination and a total amount. You need to find min number of coins required to add up to that total amount. You can […]

Travelling salesman problem with implementation

In this chapter we shall solve Travelling Salesman Problem with help of dynamic programming. Problem statement: A salesman will start from a parent city and visit all the cities only once and return to parent city. He has to do it with least cost possible. Consider the below graph and let the parent city be “a”. […]

Sliding Window technique

Introduction: This technique can be applied in different ways. It can be applied on strings and also on integers. Below are the 2 ways in which we can apply this technique. 1.Fixed size window [this technique we shall study in this chapter]: Here you will be presented with an array and a fixed size window, […]

Kadane Algorithm explanation with implementation in C++

Introduction: Kadane Algorithm is an efficient way to solve the maximum sub array problem. Explanation: So before we know about Kadane algorithm, first we shall look at that is the maximum sub array problem? You will be given with an array, you need to find the continuous sub array whose sum is the largest sum. […]

Sieve Of Eratosthenes

In this chapter we shall learn about below topics: 3.1 Introduction. 3.2 Working of the algorithm 3.3 Understanding using an example  3.4 Implementation 3.5 Output 3.1 Introduction: Sieve Of Eratosthenes is one of the most simple and efficient algorithm to find the prime numbers for a given set of limit. 3.2 Working of the algorithm: […]