斐波那契数列有多少个线程 [英] How many threads for Fibonacci series

查看:86
本文介绍了斐波那契数列有多少个线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



为了计算有效的程序,我们必须使用多少个线程来计算斐波那契数列.

朋友,请分享您的观点和想法.

Hi,

How many thread we have to use to calculate fibonacci series, to make a efficient programming.

Friends Please share your views and ideas.

推荐答案

每个系列一个.

还不清楚吗?斐波那契算法是循环的.在拥有两个前一个元素之前,您无法计算下一个元素,因此无需并行执行任何操作.当然,您可以在不同的线程中计算不同的序列,因为它们彼此不依赖.

—SA
One per a single series.

Nor clear? The Fibonacci algorithm is recurrent. You can not calculate next element before you have two previous ones, so there is nothing to do in parallel. Of course you can calculate different series in different thread, because they do not depend on each other.

—SA


这篇关于斐波那契数列有多少个线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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