CSE 100 Study Guide - Quiz Guide: Huffman Coding

82 views3 pages

Document Summary

1 byte is the smallest unit of storing memory in modern computers. Largest unsigned int represented by n bits (2 n - 1) Largest signed int represented by n bits (2 n-1 - 1) Smallest signed int represented by n bits (-2 n-1 ) Accessing the disk is and extremely slow operation. Instead of writing every single byte to disk one at a time, have a write buffer . Designate numerous bytes to be written, but instead of being written to disk immediately, they are stored in a buffer in memory, and once the buffer is full, the entire buffer is written to disk at once. Likewise for reading, since reading individual bytes is slow, instead we have a. Read buffer in memory to which we read multiple bytes from disk, and then pull individual bytes from this buffer. Int num = 12345 numfile. open( numfile ); numfile. write( (char*)&num, sizeof(num) ); numfile. close();