我如何解释什么是“天真的实现"?是? [英] How do I explain what a "naive implementation" is?

查看:55
本文介绍了我如何解释什么是“天真的实现"?是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

天真的实现"对计算机科学家的最清楚的解释是什么?我需要一个很好的清晰示例,从理论上来说,即使对于非技术人员,也可以说明,天真的实现可以从技术上解决问题,而从实践上可以解决问题完全无法使用.

What is the clearest explanation of what computer scientists mean by "the naive implementation"? I need a good clear example which will illustrate — ideally, even to non-technical people — that the naive implementation may technically be a functioning solution to the problem, but practically be utterly unusable.

推荐答案

我会尝试使其完全远离计算机.询问您的听众他们如何在词典中找到条目. (单词定义的普通词典.)

I'd try to keep it away from computers altogether. Ask your audience how they find an entry in a dictionary. (A normal dictionary of word definitions.)

幼稚的实现是从头开始,然后看第一个单词.哦,这不是我们要查找的词-查看下一个,等等.值得向听众指出,他们甚至可能甚至没有想到这种做事方式-我们足够聪明,可以立即打折!但是,这是您可以想到的最简单的方法. (问他们是否可以想到更简单的方法,并检查他们是否确实了解为什么它比我们实际操作的方法更简单,可能会很有趣.)

The naive implementation is to start at the very beginning, and look at the first word. Oh, that's not the word we're looking for - look at the next one, etc. It's worth pointing out to the audience that they probably didn't even think of that way of doing things - we're smart enough to discount it immediately! It is, however, about the simplest way you could think of. (It might be interesting to ask them whether they can think of anything simpler, and check that they do really understand why it's simpler than the way we actually do it.)

下一个实现(也是一个很好的实现)是从字典的中间开始.我们要寻找的单词是在此之前还是之后?如果在此之前,请在开始到现在的位置之间翻到一半的页面-否则,在我们现在到结束的位置到中间翻到的一半,以此类推-二进制印章.

The next implementation (and a pretty good one) is to start in the middle of the dictionary. Does the word we're looking for come before or after that? If it's before, turn to the page half way between the start and where we are now - otherwise, turn to the page half way between where we are now and the end, etc - binary chop.

实际的人工实现是利用我们对字母的了解,非常迅速地到达接近正确的地方"-如果我们看到"elephant",那么我们将知道它将在接近起点的某个地方",大概是1途中的/5.一旦到达E(可以通过非常非常简单的比较就可以做到),我们就会找到EL等.

The actual human implementation is to use our knowledge of letters to get very rapidly to "nearly the right place" - if we see "elephant" then we'll know it'll be "somewhere near the start" maybe about 1/5th of the way through. Once we've got to E (which we can do with very, very simple comparisons) we find EL etc.

这篇关于我如何解释什么是“天真的实现"?是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆