|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
翻译原文:As another example of backtracking, suppose we want to print the names in a linked list in reverse order--that is, last name first. Our problem is that the only way we can access the names is by following the linked structure. Thus we need a way of holding each name retrieved until all of the names that follow have been retrieved and printed. Our solution is to traverse the list from its beginning to its end while pushing the names we find onto a stack. After reaching the end of the list, we print the names as we pop them off the stack.
翻译答案:我们在来举另一个例子,假设反向输出一张链接表中的姓名,也就是把最后一个名字第一个输出。问题是我们只能跟着链接结构访问姓名。因此,我们需要一种方式,通过这种方式,我们可以保持每一个姓名能被检索,直到排列在这个姓名之后的姓名被得到并输出。我们的方案是从链接表的开始顺序遍历到结尾,与此同时把每一个姓名按照遍历顺序进栈。当到达链接表的末尾后,我们通过出栈操作来输出姓名。
读完一本书翻译原文:But everyone worked according to his capacity The hens and ducks, for instance, saved five bushels of corn at the harvest by gathering up the stray grains. Nobody stole, nobody grumbled over his rations, the quarrelling and
biting and jealousy which had been normal features of life in the old days had almost disappeared. Nobody shirked — or almost nobody. Mollie, it was true, was not good at getting up in the mornings, and had a way of leaving work early on the ground that there was a stone in her hoof. And the behaviour of the cat was somewhat peculiar. It was soon noticed that when there was work to be done the cat could never be found. She would vanish for hours on end, and then reappear at meal-times, or in the evening after work was over, as though nothing had happened. But she always made such excellent excuses, and purred so affectionately, that it was impossible not to believe in her good intentions. Old Benjamin, the donkey, seemed quite unchanged since the Rebellion. He did his work in the same slow obstinate way as he had done it in Jones’s time, never shirking and never volunteering for extra work either. About the Rebellion and its results he would express no opinion. When asked whether he was not happier now that Jones was gone, he would say only ‘Donkeys live a long time. None of you has ever seen a dead donkey,’ and the others had to be content with this cryptic answer.
翻译答案:但是,每个动物都只能量力而行,比如鸡和鸭子,收获时单靠他们捡拾零落的谷粒,就节约了五蒲式耳的玉米。没有谁偷吃,也没有谁为自己的口粮抱怨,那些过去习以为常的争吵、咬斗和嫉妒也几乎一扫而光。没有或者说几乎没有动物开小差逃工。不过,倒真有这样的事:莫丽不太习惯早晨起来,她还有一个坏毛病,常常借故蹄子里夹了个石子,便丢下地里的活,早早溜走了。猫的表现也多少与众不同。每当有活干的时候,大家就发现怎么也找不到猫了。她会连续几小时不见踪影,直到吃饭时,或者收工后,才若无其事一般重新露面。可是她总有绝妙的理由,咕咕噜噜地说着,简直真诚得叫谁也没法怀疑她动机良好。老本杰明,就是那头驴,起义后似乎变化不大。他还是和在琼斯时期一样,慢条斯理地干活,从不开小差,也从不支援承担额外工作。对于起义和起义的结果,他从不表态。谁要问他是否为琼斯的离去而感到高兴,他就只说一句:“驴都长寿,你们谁都没有见过死驴呢”。面对他那神秘的回答,其他动物只好就此罢休。 翻译篇(每次翻译的量都不会很大,全部翻译才有奖励哦)
非计算机方向系列:读完一本书(这是一本经典书籍,里面的每一个单词都值得查阅)
每日一句
Life is too short to waste your time on people who don't respect, appreciate, and value you.
人生太短,不要浪费在不尊重、不欣赏、也不珍惜你的人身上。 (刮刮乐,挂出大奖)
|
|