Question:
What is the optimal number of subdirectories?
Hearts
2007-08-15 16:49:54 UTC
I have 120 audio book files on one CD. My MP3 player allows me to select by directory and then by the file. There are just 2 buttons I can use - next directory, and next file. It does not matter how I divide the files into differenct directories. Currently, I have all 120 files in one directory. This means I have to press a button 12o times to reach the last file. How can I minimise the number of key presses to ANY file?
Three answers:
anonymous
2007-08-15 16:58:22 UTC
You want to minimize a + b when ab ≥ 120. Basically, that means making a and b as close to the same number as possible. So, have 10 subdirectories with 12 files per directory, or 12 subdirectories with 10 files per directory. Or, I guess, have11 subdirectories with 11 files per directory, giving you room for one more file. In all cases, that means a maximum of 22 key presses.
jw
2007-08-16 00:38:19 UTC
Can a subdirectory contain a directory? If so, consider a "binary tree" structure. That is, at the highest level have a directory with 2 subdirectories, each of which contains 2 more subdirectories, etc., until you have a structure 7 levels deep (counting the highest-level directory as level 1). At the lowest level, you will have 64 (= 2^6) directories. Put 2 files in each of the lowest-level directories. In this way you can reach any of up to 128 files in just 7 clicks.
ironduke8159
2007-08-16 00:17:18 UTC
zanti is right about 11 directories and 11 files/directory.

Are you sure you can't select previous directory? That would be an enormous help. When you reach the last directory, does pressing "NEXT DIRECTORY" take you back to Directory #1? I'd suggest you get an MP3 player that allows you to go directly to a particular directory or at least allows you to go to the previous directory.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...