4 ms·
This contains many questions that leave me asking "but why would you do that?" A hash table for 1,000,000 entries with only 128 buckets? A page size of 32 bytes
by diiq 15y ago
This contains many questions that leave me asking "but why would you do that?" A hash table for 1,000,000 entries with only 128 buckets? A page size of 32 bytes? Tests are learning experiences, and should suggest real, worthy solutions.
- alexgartrell 15y agoI TAed a class in college three times that covers a lot of the stuff on this test. Smaller "unrealistic" numbers allow you to focus on the concepts while also minimizing the odds of an off-by-one type error in counting. For example, the actual 32-bit float format is 1 sign bit, 8 exponent bits, and 23 mantissa (or fraction) bits. The number 4.5 looks like this 0100 0000 1001 0000 0000 0000 0000 0000 Compare this to the 1-3-4 format (commonly used on tests in the class) 0101 0010 Even with that simple example, it's much clearer, and you're still calculating the bias and doing all of the binary conversion and binary point movement. When you start to consider the more complicated aspects (like rounding), using the actual 32 bit format becomes unfair to students. 32 byte pages are helpful because it keeps addresses short, and there's nothing fundamentally more interesting about a 12 bit page offset than about a 5 bit page offset.