## Cut all the rods with some length such that the sum of cut-off length is maximized

Given N rods of different lengths. The task is to cut all the rods with some maximum integer height ‘h’ such that sum of cut-off… Read More »

Given N rods of different lengths. The task is to cut all the rods with some maximum integer height ‘h’ such that sum of cut-off… Read More »

Given an array of positive integers containing the price of stocks and transaction fee, the task is to find the maximum profit and the difference… Read More »

Given an array of positive integers. The task is to choose a pair of elements from the given array such that they represent the length… Read More »

Given an array of N numbers, the task is to find the maximum sum that can be obtained by adding numbers with the same number… Read More »

Given an array containing N integers. The task is to find the sum of the elements of the contiguous subarray having the smallest(minimum) sum. Examples:… Read More »

Given two arrays of size N, and two numbers X and Y, the task is to maximize the sum by considering the below points: Pick… Read More »

You are given 3 stacks, A(Input Stack), B(Auxiliary Stack) and C(Output Stack). Initially stack A contains numbers from 1 to N, you need to transfer… Read More »

In the previous post, top 10 algorithms/questions on different topics that are most asked in interviews is discussed. In this post, top 10 problems on… Read More »

Given N questions in a test and K students in the class. Out of the batch of K students, N students memorised exactly one question… Read More »

Given N, print the sequence of a minimum number of steps in which N can be obtained starting from 0 using addition or subtraction of… Read More »

There are n cores of processor. Each core can process a task at a time. Different cores can process different tasks simultaneously without affecting others.… Read More »

Which of the following is true about Huffman Coding. (A) Huffman coding may become lossy in some cases (B) Huffman Codes may not be optimal… Read More »

Which of the following is true about Kruskal and Prim MST algorithms? Assume that Prim is implemented for adjacency list representation using Binary Heap and… Read More »

In question #2, which of the following represents the word “dead”? (A) 1011111100101 (B) 0100000011010 (C) Both A and B (D) None of these Answer:… Read More »

What is the time complexity of Huffman Coding? (A) O(N) (B) O(NlogN) (C) O(N(logN)^2) (D) O(N^2) Answer: (B) Explanation: O(nlogn) where n is the number… Read More »