题目内容 (请给出正确答案)
[单选题]

判断下列代码段的大O级别 test = 0 for i in range(n): test = test + 1 for j in range(n): test = test - 1

A.O(n)

B.O(n^2)

C.O(log n)

D.O(n^3)

提问人:网友linda6 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
网友答案
查看全部
  • · 有3位网友选择 B,占比33.33%
  • · 有2位网友选择 C,占比22.22%
  • · 有2位网友选择 A,占比22.22%
  • · 有2位网友选择 D,占比22.22%
匿名网友 选择了A
[44.***.***.91] 1天前
匿名网友 选择了B
[25.***.***.137] 1天前
匿名网友 选择了D
[18.***.***.228] 1天前
匿名网友 选择了A
[86.***.***.211] 1天前
匿名网友 选择了C
[74.***.***.22] 1天前
匿名网友 选择了D
[84.***.***.77] 1天前
匿名网友 选择了B
[149.***.***.90] 1天前
匿名网友 选择了C
[122.***.***.186] 1天前
匿名网友 选择了B
[100.***.***.79] 1天前
加载更多
提交我的答案
登录提交答案,可赢取奖励机会。
更多“判断下列代码段的大O级别 test = 0 for i in…”相关的问题
第1题
有以下程序#include <iostream>using namespace std;class sample{private: int x;public: sample(int a) { x=a; } friend double square(sample s);};double square(sample s){ return s. x*s. x;}int main(){ sample s1(20),s2(30); cout<<square(s2)<<end1; return 0;}执行结果是()。

A.20

B.30

C.900

D.400

点击查看答案
第2题
假设程序中已有定义:int s=0, i; 下列哪一段代码无法正确实现求1到10的和______。

A、for (i=1; i<=10 ;i++) s+="i;&lt;br"> B、for (i=1; ; i++) { if (i>10) break; s+=i; }

C、i=1; while (i<=10) s+="i++;&lt;br"> D、i=1; do { s+=++i; }while (i<=10);<br>

点击查看答案
第3题
下面程序的运行结果是【 】。

include <iostream>

using namespace std;

class count

{

static int n;

public:

count()

{

n++;

}

static int test()

{

for(int i=0;i<4;i++)

n++;

return n;

}

};

int count::n = O;

int main()

{

cout<<count:: test()<<" ";

count c1, c2;

cout<<count:: test()<<endl;

return 0;

}

点击查看答案
第4题
How to approach Reading Test Part Three

•In this part of the Reading Test you read a longer text and answer six questions.

•First read the questions, Try to get an idea of what the text will be about. Then read the text for general understanding,

•Then read the text and questions more carefully, choosing the best answer to each question. Do not choose an answer just because you can see the same words in the text.

? Read the article on the opposite page about innovation in business and the questions below.

? For each question 15 - 20, mark one letter (A, B, C or D) on your Answer Sheet for the answer you choose.

Not long ago innovation was The Big Idea in marketing circles. Now, however, it's hard to see the benefits of this rush to innovate. Indeed if anything, companies seem to be drawing back from innovation, not charging ahead. But just a few years ago many companies were combining a commitment to create entirely new product categories through innovative technologies - working to hugely ambitious growth targets -with a root-and-branch organisational overhaul designed to free up creativity and speed new product roll-outs.

The result was that as resources were shifted away from core businesses, sales and profits faltered, share prices slumped and CEOs were ousted. Now the mantra is a more conservative focus on the top brands, the top retail customers and the top markets. It's being rewarded in many cases by healthier share prices. This sustained effort to cut long tails of smaller brands and focus marketing resource on existing leaders seems to be paying off.

So were we wrong to pinpoint innovation as key to tong-term market success? Surely not. But we might have underestimated the enormous complexity of this beast. The term 'innovation' may be simple enough but it spans a vast landscape, including the type and degree of innovation, marketing purpose, management process and market circumstance - not all of which are well understood.

Take 'type' of innovation. Are we talking about new products only? Or new processes, new channels, underlying technologies, organisational structures and business models? When should the innovation involve a new brand? Or take 'degree'. Are we aiming for blue-sky inventions that will transform. markets and create new categories? Or marginal tweaks in, say, formulation or packaging that give us an excuse to advertise something 'New! Improved!'? Likewise, is the marketing purpose of the project to steal a march on competitors and drive incremental growth, or to update an obsolete product line and play catch-up to competitors? As one business news editorial complained, 'innovation' is often just 'simple proliferation of similar products'. Then there's process. What is the best way to manage this particular innovation? Is it to employ creative revolutionaries and set them free, or is disciplined risk management, requiring the careful testing and sifting of options to pick winners, a better approach? In larger organisations, has, senior management really made time spent in cross4unctional teams a recognised element of successful career paths? What time frames (eg payback periods) and degrees of risk is senior management comfortable with? And does the organisation have a culture that fits the chosen approach? Does it 'celebrate failure', for example, or is it actually a risk-averse blame culture (despite what the CEO says in the annual report)?

Successful innovation requires clearing two hurdles. First, it needs the right project with the right degree of innovation to fit with the right marketing purpose, the right innovation process, corporate culture and market circumstance. Second, it needs senior managers that understand the interplay between these different factors, so that rather than coming together simply by chance, they are deliberately broug

A.trusted in technology to improve existing products.

B.chose to focus heavily on marketing activities.

C.expected that growth would increase steadily, '

D.believed they needed to produce new goods.

点击查看答案
第5题
判断下列代码段的大O级别 test = 0 for i in range(n): for j in range(n): test = test + i * j

A、O(n)

B、O(n^2)

C、O(log n)

D、O(n^3)

点击查看答案
第6题
判断下列代码段的大O级别 i = n while i > 0: k = 2 + 2 i = i // 2

A、O(n)

B、O(n^2)

C、O(log n)

D、O(n^3)

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信