《Algorithms in Java: Parts 1-4, Third Edition》是一本用Java語(yǔ)言講解算法的書(shū),我正在閱讀中。因?yàn)槭怯⑽脑娴模瑥?fù)習(xí)的時(shí)候不容易看。因?yàn)橹袊?guó)人嘛,對(duì)母語(yǔ)的反應(yīng)是最快的。雖然英語(yǔ)不是很好,以前也沒(méi)翻譯過(guò)什么東西,但是還是想盡我所能,以意譯為主吧,學(xué)好算法這門(mén)必修課,和大家共同分享。

          2007年10月11日 21:00:01
          2007年10月12日 8:35:34 翻譯

          Form:《Algorithms in Java: Parts 1-4, Third Edition》

          1、 Most algorithms of interest involve methods of organizing the data involved in the computation. Objects created in this way are called data structures, and they also are central objects of study in computer science. Thus, algorithms and data structures go hand in hand.
          大多數(shù)重要的算法,包含了在計(jì)算中方法需要處理的組織起來(lái)的數(shù)據(jù)。以這種方式創(chuàng)建的對(duì)象我們稱(chēng)之為數(shù)據(jù)結(jié)構(gòu)。它們也是計(jì)算機(jī)科學(xué)研究和核心問(wèn)題。因此,數(shù)據(jù)結(jié)構(gòu)和算法是密不可分的。
          (特定的數(shù)據(jù)結(jié)構(gòu)有特定的算法,比如:估算降雨量要用毫米數(shù),不能用雨滴的個(gè)數(shù)。在這種問(wèn)題上,越是精確,越是沒(méi)意義。模糊數(shù)學(xué)里的東西。)

          2、 Careful algorithm design is an extremely effective part of the process of solving a huge problem, whatever the applications area.
          無(wú)論在什么應(yīng)用領(lǐng)域,精心設(shè)計(jì)的算法能夠非常高效地解決大的問(wèn)題。
          (好像聽(tīng)人說(shuō)過(guò),一種科學(xué),如果沒(méi)用上數(shù)學(xué),那就稱(chēng)不上是嚴(yán)謹(jǐn)?shù)目茖W(xué)。大概這個(gè)意思吧。)

          3、 When a huge or complex computer program is to be developed, a great deal of effort must go into understanding and defining the problem to be solved, managing its complexity, and decomposing it into smaller subtasks that can be implemented easily.
          當(dāng)要開(kāi)發(fā)一個(gè)復(fù)雜的計(jì)算機(jī)程序,必須付出巨大的努力理解和定義問(wèn)題的解決方式,管理復(fù)雜度,把它分解成可以很容易實(shí)現(xiàn)的子任務(wù)。
          (分而治之是最基本的思想)

          4、 The Java libraries contain implementations of a host of fundamental algorithms. However, implementing simple versions of basic algorithms helps us to understand them better and thus to more effectively use and tune advanced versions from a library. More important, the opportunity to reimplement basic algorithms arises frequently. The primary reason to do so is that we are faced, all too often, with completely new computing environments (hardware and software) with new features that old implementations may not use to best advantage. In other words, we often implement basic algorithms tailored to our problem, rather than depending on a system routine, to make our solutions more portable and longer lasting. Another common reason to reimplement basic algorithms is that, despite the advances embodied in Java, the mechanisms that we use for sharing software are not always sufficiently powerful to allow us to conveniently tailor library programs to perform effectively on specific tasks.
          java庫(kù)包含了大量的基礎(chǔ)算法的實(shí)現(xiàn)。然而,實(shí)現(xiàn)簡(jiǎn)單版本的基本算法幫助我們更好地理解它們,這樣就能更高效地 運(yùn)用它們,并且從庫(kù)中使用更高級(jí)的版本。更重要的是,重新實(shí)現(xiàn)基本算法的機(jī)會(huì)變得很頻繁。這樣做的主要原因是我們會(huì)遇到,并且經(jīng)常遇到全新的計(jì)算機(jī)環(huán)境 (軟件和硬件),這樣舊有的實(shí)現(xiàn)就可能不是最佳的了。換句話(huà)說(shuō),我們經(jīng)常根據(jù)我們的問(wèn)題實(shí)現(xiàn)基本算法,而不是例行公事地,讓我們的解決方案更便捷、持續(xù)得 更長(zhǎng)久。另一個(gè)很普遍的原因是重新實(shí)現(xiàn)基本的算法,不管java包含的算法如何優(yōu)秀,我們?cè)谠O(shè)計(jì)軟件時(shí)采用它實(shí)現(xiàn)的機(jī)制,并不能總是滿(mǎn)足我們特定任務(wù)的需 要。
          (也就是說(shuō)在特定的情況下,需要我們根據(jù)問(wèn)題來(lái)實(shí)現(xiàn)基本的算法,而不是java的庫(kù),庫(kù)只是通用的,有時(shí)并不能滿(mǎn)足特定的需要。不要以為學(xué)習(xí)基本算法是在重新發(fā)明輪子。有個(gè)叫劉喆的同學(xué)也說(shuō)過(guò)類(lèi)似的話(huà)^_^)

          5、 Computer programs are often overoptimized. It may not be worthwhile to take pains to ensure that an implementation of a particular algorithm is the most efficient possible unless the algorithm is to be used for an enormous task or is to be used many times.
          計(jì)算機(jī)程序經(jīng)常地被過(guò)度地優(yōu)化。有時(shí),努力地確保一個(gè)算法的實(shí)現(xiàn)是最高效的并不值得,除非那個(gè)算法被用來(lái)處理復(fù)雜的任務(wù),或者會(huì)被多次地使用。
          (在Joshua Bloch著的《Effective Java》中有過(guò)相同的論述,很有意思。他提出兩條規(guī)則:第一條,不要做優(yōu)化。第二條,(僅針對(duì)專(zhuān)家)還是不要做優(yōu)化---也就是說(shuō),在你沒(méi)有絕對(duì)清晰的 未優(yōu)化方案之前,請(qǐng)不要做優(yōu)化。他是java庫(kù)的設(shè)計(jì)者之一,說(shuō)話(huà)的分量夠重吧。現(xiàn)在好像跳到google了。

          6、 We do pay careful attention to carefully coding the critical parts of the algorithms, and take pains to note where low-level optimization effort could be most beneficial.
          我們一定要特別注意仔細(xì)地為算法關(guān)鍵部分的編碼,努力地注意以很小代價(jià)做的優(yōu)化,獲得最好的效果。
          (也就是算法中最核心的部分,有點(diǎn)80/20原則的意味。)

          7、 The choice of the best algorithm for a particular task can be a complicated process, perhaps involving sophisticated mathematical analysis. The branch of computer science that comprises the study of such questions is called analysis of algorithms.
          為一個(gè)特定的任務(wù)選擇最佳算法可能是一個(gè)復(fù)雜的過(guò)程,也許包含了精密的數(shù)學(xué)分析。算法分析就是研究這種問(wèn)題的學(xué)科,它是計(jì)算機(jī)科學(xué)的一個(gè)分支。
          (看來(lái)學(xué)計(jì)算機(jī)要學(xué)的深入,不學(xué)數(shù)學(xué)是不行的,我得惡補(bǔ)一下了。)

          8、 We should not use an algorithm without having an idea of what resources it might consume, and we strive to be aware of how our algorithms might be expected to perform.
          我們不應(yīng)該只是使用一個(gè)算法,而不在意他消耗了多少資源(時(shí)間和空間),我們應(yīng)該密切留意我們的算法能否達(dá)到預(yù)期的效果。
          (生了孩子就要對(duì)他/她負(fù)責(zé),否則就不要生他/她。)

          Feedback

          # re: 讀書(shū)筆記-《Algorithms in Java》-第一章-07/10/11 [未登錄](méi)  回復(fù)  更多評(píng)論   

          2007-10-13 14:05 by daniel
          謝謝, 加油!

          # re: 讀書(shū)筆記-《Algorithms in Java》-第一章-07/10/11   回復(fù)  更多評(píng)論   

          2007-10-13 21:25 by Raylong
          @daniel
          我會(huì)努力的,我宿舍有個(gè)哥們也叫Daniel,真巧了。

          # re: 讀書(shū)筆記-《Algorithms in Java》-第一章-07/10/11   回復(fù)  更多評(píng)論   

          2007-10-14 12:30 by ZelluX
          呵呵,數(shù)學(xué)的確很重要啊

          # re: 讀書(shū)筆記-《Algorithms in Java》-第一章-07/10/11   回復(fù)  更多評(píng)論   

          2007-10-14 15:12 by Raylong
          @ZelluX
          看了你的blog,好厲害啊!!!向你看齊了!

          # re: 讀書(shū)筆記-《Algorithms in Java》-第一章-07/10/11   回復(fù)  更多評(píng)論   

          2007-11-02 09:46 by zhrb
          不知道有沒(méi)有中文版的?呵呵
          英文畢竟沒(méi)那么順手

          # re: 讀書(shū)筆記-《Algorithms in Java》-第一章-07/10/11   回復(fù)  更多評(píng)論   

          2007-11-02 10:06 by Raylong
          @zhrb
          我沒(méi)找到,不知道你數(shù)據(jù)結(jié)構(gòu)和算法看的是那本書(shū)?給推薦一個(gè)吧

          # re: 讀書(shū)筆記-《Algorithms in Java》-第一章-07/10/11   回復(fù)  更多評(píng)論   

          2007-11-02 20:58 by zhrb
          @Raylong
          一個(gè)是傅青翔老師的,還有一本是清華的
          推薦算不上,不過(guò)你可以去看看
          主站蜘蛛池模板: 铜川市| 赤城县| 板桥市| 新源县| 五莲县| 平和县| 老河口市| 泸定县| 确山县| 晋城| 宾川县| 定远县| 资讯 | 苏尼特右旗| 安泽县| 工布江达县| 宜昌市| 涞源县| 郴州市| 屏东县| 宝山区| 商城县| 贞丰县| 山阴县| 莲花县| 屏南县| 潮州市| 康定县| 聂荣县| 兰州市| 通海县| 永川市| 瑞丽市| 长沙市| 南靖县| 巴林左旗| 合作市| 曲靖市| 九龙县| 青阳县| 澎湖县|