## Greedy Algorithm for Egyptian Fraction

Every positive fraction can be represented as sum of unique unit fractions. A fraction is unit fraction if numerator is 1 and denominator is a… Read More »

- Spanning Tree With Maximum Degree (Using Kruskal's Algorithm)
- Optimal File Merge Patterns
- Find Intersection of all Intervals
- Given count of digits 1, 2, 3, 4, find the maximum sum possible
- Find the maximum possible value of a[i] % a[j] over all pairs of i and j
- Maximum number of candies that can be bought
- Minimum number of pairs required to make two strings same
- Minimum elements to be removed such that sum of adjacent elements is always odd
- Minimum operations to make frequency of all characters equal K
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Greedy approach vs Dynamic programming
- Minimum cuts required to convert a palindromic string to a different palindromic string
- Maximum distance between two unequal elements
- Check whether a subsequence exists with sum equal to k if arr[i]> 2*arr[i-1]
- Count common elements in two arrays containing multiples of N and M
- Count all possible N digit numbers that satisfy the given condition
- Find the minimum number of steps to reach M from N
- Find smallest number K such that K % p = 0 and q % K = 0
- Maximal Disjoint Intervals
- Divide a number into two parts
- Count possible moves in the given direction in a grid
- Find the sum of digits of a number at even and odd places
- Find n positive integers that satisfy the given equations
- Minimum LCM and GCD possible among all possible sub-arrays
- Find the Kth smallest element in the sorted generated array
- Create a Sorted Array Using Binary Search
- Count the pairs of vowels in the given string
- Minimum deletions required such that any number X will occur exactly X times
- Minimum deletions required to make GCD of the array equal to 1
- Maximum count of sub-strings of length K consisting of same characters

Every positive fraction can be represented as sum of unique unit fractions. A fraction is unit fraction if numerator is 1 and denominator is a… Read More »

Given a number of friends who have to give or take some amount of money from one another. Design an algorithm by which the total… Read More »

Given an array of jobs where every job has a deadline and associated profit if the job is finished before the deadline. It is also… Read More »

Given arrival and departure times of all trains that reach a railway station, the task is to find the minimum number of platforms required for… Read More »

MakeMyTrip recently visited our campus.Below is my interview experience: Round 1: (Online MCQs) Section A- There were 20 Aptitude and Logical Reasoning questions which has… Read More »

There are given n ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal… Read More »

Given a string and a positive integer d. Some characters may be repeated in the given string. Rearrange characters of the given string such that… Read More »

We introduced graph coloring and applications in previous post. As discussed in the previous post, graph coloring is widely used. Unfortunately, there is no efficient… Read More »

We recommend to read following two posts as a prerequisite of this post. 1. Greedy Algorithms | Set 7 (Dijkstra’s shortest path algorithm) 2. Graph and… Read More »

Given a graph and a source vertex in the graph, find shortest paths from source to all vertices in the given graph. Dijkstra’s algorithm is… Read More »

We recommend to read following two posts as a prerequisite of this post. 1. Greedy Algorithms | Set 5 (Prim’s Minimum Spanning Tree (MST)) 2.… Read More »

We have discussed Kruskal’s algorithm for Minimum Spanning Tree. Like Kruskal’s algorithm, Prim’s algorithm is also a Greedy algorithm. It starts with an empty spanning tree. The… Read More »

We recommend to read following post as a prerequisite for this. Greedy Algorithms | Set 3 (Huffman Coding) Time complexity of the algorithm discussed in… Read More »

What is Minimum Spanning Tree? Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and… Read More »