Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate… Read More

# Category Archives: Greedy

You are given a list of N coins of different denominations. you can pay an amount equivalent to any 1 coin and can acquire that… Read More

Given n objects, with each object has width wi. We need to arrange them in a pyramidal way such that : Total width of ith… Read More

Given two arrays a[] and b[] of equal length n. The task is to pair each element of array a to an element in array… Read More

Given a string with repeated characters, the task is to rearrange characters in a string so that no two adjacent characters are same. Note :… Read More

Given a permutation of first n natural numbers as array and an integer k. Print the lexicographically largest permutation after at most k swaps Examples: … Read More

Given an array of n elements. Consider array as circular array i.e element after an is a1. The task is to find maximum sum of… Read More

Prerequisite : Partition allocation methods Worst Fit allocates a process to the partition which is largest sufficient among the freely available partitions available in the… Read More

Prerequisite : Partition allocation methods Best fit allocates the process to a partition which is the smallest sufficient partition among the free available partitions. Example:… Read More

Prerequisite : Partition Allocation Methods In the first fit, the partition is allocated which is first sufficient from the top of Main Memory. Example :… Read More

Given an array arr[], find the lexicographically smallest array that can be obtained after performing at maximum of k consecutive swaps. Examples : Input: arr[]… Read More

Maximum flow problems involve finding a feasible flow through a single-source, single-sink flow network that is maximum. Let’s take an image to explain how the… Read More

Reverse Delete algorithm is closely related to Kruskal’s algorithm. In Kruskal’s algorithm what we do is : Sort edges by increasing order of their weights.… Read More

1st round consisted of 20mcq questions to be answered in 30 minutes. Around 120 students appeared for the test. Top 5 were called directly for… Read More