Category Archives: Algorithm

Temple Offerings

Consider a devotee wishing to give offerings to temples along a mountain range. The temples are located in a row at different heights. Each temple should receive at least one offering. If two adjacent temples are at different altitudes, then the temple that is higher up should receive more offerings than the one that is… Read More »

Top 20 Greedy Algorithms Interview Questions

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 benefit. Greedy algorithms are used for optimization problems. ‘Recent Articles’ on Greedy Algorithms ‘Coding Problems’ on Greedy Algorithms ‘Quiz’ on Greedy Algorithms ‘Videos’ on Greedy Algorithms   Activity Selection Problem… Read More »

Auxiliary Space with Recursive Functions

Prerequisite : Recursion Memory used by a program is sometimes as important as running time, particularly in constrained environments such as mobile devices. For example if we need to create an array of size n, it will require O(n) space. If we need a two-dimensional array of size n x n , it will require… Read More »

Top 20 Dynamic Programming Interview Questions

Dynamic Programming is an algorithmic paradigm that solves a given complex problem by breaking it into subproblems and stores the results of subproblems to avoid computing the same results again. Following are the most important Dynamic Programming problems asked in various Technical Interviews. ‘Recent Articles’ on Dynamic Programming ‘Coding Problems’ on Dynamic Programming ‘Quiz’ on… Read More »