A text export tool offers UTF-8 and UTF-16. The encoded size of a string is the number of bytes produced by its character encoding.
Use these rules for the strings in the table:
Treat é as one stored character, and count each displayed character once. Include only the encoded text: there are no headers, terminators, or other additional bytes. Enter exact integers in every blank.
Unlock full course notes by signing up
When packing starts to save space
An instrument can store records in text at 14 bytes per record with no header, or in a packed format at 8 bytes per record with a 300-byte header per file. Both preserve all required information, and neither has other storage overhead. What is the smallest number of records in one file for which the packed format uses strictly fewer bytes? Answer in records, as an integer with zero decimal places.
Storage savings and decoding time
An application downloads one dataset before displaying it. The raw format is 8 MB and needs no decoding time. A lossless packed format is 3 MB and needs 1.0 s to decode after the entire download finishes. Both recover the same data. The transfer rate is a constant 2 MB/s, and all other delays are negligible. Only these two formats are available.
Calculate each format's total time until the data are ready, in seconds to one decimal place. Then enter raw or packed for the format that meets a 3.0 s readiness limit.
Preserving meaning across systems
A laboratory exchanges measurement files between two different computer systems. Every value is an exact multiple of 0.01 mg within the supported range of every candidate format. Identifiers contain digits with significant leading zeros and varying lengths. The receiving system must recover identifiers exactly and values exactly in mg. Both systems support the stated text and packed encodings. Which proposals satisfy these requirements? Select all that apply.
From aligned memory to packed records
A sensor program stores records in memory using the following field order. Each record begins at an address divisible by 4, and offsets are measured in bytes from that record's start.
Here, alignment requires a field's starting offset to be divisible by its stated boundary. Place each field at the earliest permitted offset after the preceding field, inserting padding when necessary.
After placing all fields, add the minimum trailing padding needed to make the complete record size divisible by 4. Records in an array occupy consecutive complete record slots.