算术左移时间复杂度 [英] Arithmetic Left shift time complexity

查看:158
本文介绍了算术左移时间复杂度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是*算术左移的的时间复杂度 * A N位操作数,例如做X = Y&LT的/ *的算术右移*运营商;< 2; whow多的时间将它带到?

What is the time complexity of * Arithmetic left shift* / * Arithmetic right shift* operators of a n bit operand for example doing x = y << 2; whow much time will it take ?

推荐答案

复杂性,用O(...)符号,是当输入尺寸不断变大的算法花费的时间渐近表征。它是没有意义的为,可以采取仅输入一个有限数量的算法。 &LT;&LT; 可容纳2 ^ 32 * 32个不同的投入,因此投入是有限的,因此它是恒定的时间(O(1))

Complexity, with the O(…) notation, is an asymptotic characterization of the time an algorithm takes when the input size becomes larger and larger. It is meaningless for algorithms that can take only a finite number of inputs. << can take 2^32 * 32 different inputs, hence a finite number of inputs, therefore it is constant-time (O(1)).

这篇关于算术左移时间复杂度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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