chap algorithm analysis of its correct position once it has been placed thereand each swap operation places at least one integer in its correct position thusthis code fragment has cost th(nhoweverit requires more time to run than the first code fragment on my computer the second version takes nearly twice as long to run as the firstbut it only requires half the space second principle for the relationship between program' space and time requirements applies to programs that process information stored on diskas discussed in and thereafter strangely enoughthe disk-based space/time tradeoff principle is almost the reverse of the space/time tradeoff principle for programs using main memory the disk-based space/time tradeoff principle states that the smaller you can make your disk storage requirementsthe faster your program will run this is because the time to read information from disk is enormous compared to computation timeso almost any amount of additional computation needed to unpack the data is going to be less than the disk-reading time saved by reducing the storage requirements naturally this principle does not hold true in all casesbut it is good to keep in mind when designing programs that process information stored on disk speeding up your programs in practicethere is not such big difference in running time between an algorithm whose growth rate is th(nand another whose growth rate is th( log nthere ishoweveran enormous difference in running time between algorithms with growth rates of th( log nand th( as you shall see during the course of your study of common data structures and algorithmsit is not unusual that problem whose obvious solution requires th( time also has solution that requires th( log ntime examples include sorting and searchingtwo of the most important computer problems example the following is true story few years agoone of my graduate students had big problem his thesis work involved several intricate operations on large database he was now working on the final step "dr shaffer,he said" am running this program and it seems to be taking long time after examining the algorithm we realized that its running time was th( )and that it would likely take one to two weeks to complete even if we could keep the computer running uninterrupted for that longhe was hoping to complete his thesis and graduate before then fortunatelywe realized that there was fairly easy way to convert the algorithm so that its running time was th( log nby the next day he