皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
Project 1: Performance Measurement Given a list of ordered N integers, numbered from 0 to N–1, checking to see that N is not in this list provides a worst case for many search algorithms. Consider two algorithms: one is called “ sequential search ” which scans through the list from left to right; and the other is “ binary search ” which is given on our PPT. Your tasks are: (1) Implement an iterative version and a recursive version of sequential search; (2) Implement an iterative version of binary search; (3) Analyze the worst case complexities of the above two versions of sequential search and that of binary search; (4) Measure and compare the worst case performances of the above three functions for N= 100,500,1000,2000,4000,6000,8000,10000. To measure the performance of a function, we may use C’s standard library time.h as the following: Note: If a function runs so quickly that it takes less than a tick to finish, we may repeat the function calls for K times to obtain a total run time(“ Total Time ”), and then divide the total time by K to obtain a more accurate duration(“ Duration ”) for a single fun of the function. The repetition factor must by large enough so that the number of elapsed ticks is at least 10 if we want an accuracy of at least 10%. The test results must be listed in the following table: The performances of the three functions must be plotted in the same N-running time coordinate system for illustration. project_1_班级_学号_姓名.doc
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】Which is the highest mountain range in North America?
A.
Pacific Coast
B.
Rocky Mountains
C.
Appalachian Mountains
D.
Canadian Shield
【单选题】鸭病毒性肝炎多发生在()鸭。
A.
老龄
B.
1~2周龄
C.
2月龄
D.
3月以后
【单选题】鸭病毒性肝炎多发生在 ( ) 鸭。
A.
老龄
B.
1~3周龄
C.
2月龄
D.
4月龄
【单选题】分布于眼虹膜辐射肌,激活时可引起该肌收缩的受体是
A.
M受体
B.
N受体
C.
α受体
D.
β受体
【多选题】患儿男,生后20小时,生后即有呼吸困难,加重伴青紫1小时。足月,因胎儿宫内窘迫剖宫产分娩;出生Apgar评分1分钟,5分钟分别为3分,8分;羊水Ⅲ度污染,生后经清理气道,复苏气囊面罩加压通气后转入儿科,进行吸氧、补液、抗感染治疗。目前监测脉搏氧饱和度右手为68%,左足为54%。在病程4~5周需要做的检查有()。
A.
血常规
B.
肝功能
C.
视网膜病筛查
D.
颅脑MR
E.
血培养
F.
心脏超声
【简答题】Discuss with your classmates whether there are any problems in the following letters and how you can improve them. Then contrast your improved letters with original ones. Dear Sirs: Please consider me...
【单选题】“人无礼而不生,事无礼则不成,国无礼则不宁”的提出者是
A.
孔子
B.
荀子
C.
孟子
D.
韩非子
【单选题】I have a position in a foreign company.
A.
职位
B.
地位
C.
职业
【单选题】Which is the highest mountain range in north America?
A.
Pacific Coast
B.
Rocky Mountains
C.
Appalachian Mountains
D.
Canadian Shield
【单选题】河北省南部地区葡萄冬季埋土防寒目的主要是防止( )。
A.
芽受冻
B.
根系受冻
C.
枝蔓受冻
D.
枝蔓抽干
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题