大学职业搜题刷题APP
下载APP
首页
课程
题库模板
Word题库模板
Excel题库模板
PDF题库模板
医考护考模板
答案在末尾模板
答案分章节末尾模板
题库创建教程
创建题库
登录
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) yze 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
微信扫一扫
微信内点击右上角“…”即可分享
反馈
收藏 - 刷刷题收藏
举报
参考答案:
举一反三
相关题目:
刷刷题-刷题-导入试题 - 刷刷题
参考解析:
AI解析
重新生成
题目纠错 0
发布
刷刷题-刷题-导入试题 - 刷刷题刷刷题-刷题-导入试题 - 刷刷题刷刷题-刷题-导入试题 - 刷刷题
刷刷题-刷题-导入试题 - 刷刷题
刷刷题-刷题-导入试题 - 刷刷题
刷刷题-单词鸭