Книга: A Common-Sense Guide to Data Structures and Algorithms in Python, Volume 2 (for True Epub)
Назад: A First Attempt: Two-Way External Mergesort
Дальше: A Second Attempt at External Mergesort

M = Main Memory Size

We know that N represents the amount of data we’re dealing with. In the prior example, N=32, since the list has 32 data elements. And we’ve also learned that B represents the computer’s block size. In our example, B=4.

Now it’s time to take a look at a new variable that is going to play an important role in our analysis of external-memory algorithms going forward: a variable that computer scientists call M. This M variable represents the size of RAM.

In the previous scenario, we used an example of RAM being able to contain 8 elements. And so, we’d say that M=8.

That’s it; there’s nothing earth-shattering here. It’s just that going forward, I’m going to talk about M a lot. By digging into M further, you’re going to level up your ability to analyze external-memory algorithms.

Назад: A First Attempt: Two-Way External Mergesort
Дальше: A Second Attempt at External Mergesort