卷別
資料結構
選擇國立中央大學 2026 · 考試 · 第 46 題
We have implemented a method to perform basic string compression using the counts of repeated characters. For example, the string "aaabbbbcccc" would be "a3b4c5". Which of the following strings will have the best compression ratio, which length(compressed_string)/length(original_string) is the smallest.
- (A)
0001100000111110110011011111011111 - (B)
aaaahhhhhhheeeeeeeeeiiiiiiioooooo - (C)
999111118866666666666666666688888 - (D)
&&&&&&&&%%%%%%%%$$$$########### - (E)
Implementedamethodtoperformbasic