Top "Clrs" questions

CLRS refers to the textbook "Introduction to Algorithms" by Thomas H. Cormen, Charles E. Leiserson, Ronald R. Rivest, and Clifford Stein.

What is a loop invariant?

I'm reading "Introduction to Algorithm" by CLRS. In chapter 2, the authors mention "loop invariants". What is a loop invariant?

algorithm terminology definition clrs loop-invariant
Recursive matrix multiplication

I am reading Introduction to Algorithms by CLRS. Book shows pseudocode for simple divide and conquer matrix multiplication: n = A.…

c++ algorithm matrix matrix-multiplication clrs
maximum sum of a subset of size K with sum less than M

Given: array of integers value K,M Question: Find the maximum sum which we can obtain from all K element …

algorithm data-structures dynamic-programming subset-sum clrs
Unbiased random number generator using a biased one

You have a biased random number generator that produces a 1 with a probability p and 0 with a probability (1-p). You …

algorithm random probability clrs
worst case in MAX-HEAPIFY: "the worst case occurs when the bottom level of the tree is exactly half full"

In CLRS, third Edition, on page 155, it is given that in MAX-HEAPIFY, "the worst case occurs when the bottom level …

algorithm heap clrs
Graph - Square of a directed graph

Yes, this will be a homework (I am self-learning not for university) question but I am not asking for solution. …

algorithm data-structures graph clrs
Implementing a direct address table

I was given as homework the Introduction to Algorithms exercise 11.1-3 which goes as follows: Suggest how to implement a …

algorithm hash hashtable clrs