当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

复旦大学:《数据结构与算法设计》综合项目_Project1. Combining quicksort with insertion sort

资源类别:文库,文档格式:PDF,文档页数:1,文件大小:8.5KB,团购合买
点击下载完整版文档(PDF)

Project 1 1. Write code for insertion sort (10 points) 2. Write code for quicksort(10 points) 3. The running time of quicksort can be improved in practice by taking advantage of the fast running time of insertion sort when its input is"nearly"sorted. When quicksort is called on subarray with fewer than k elements, let it simply return without sorting the subarray. After the top-level call to quicksort returns, run insertion sort on the entire array to finish the sorting process Argue that this sorting algorithm runs in O(nk nIg(n/k)expected time. How should k be picked both in theory and in practice by experiments? (40 points) 4. Write code for improved version of sorting algorithm which combines quicksort with insertion sort(20 points) 5. All document for the answers of the above questions. (20 points)

1 Project 1 1. Write code for insertion sort. (10 points) 2. Write code for quicksort. (10 points) 3. The running time of quicksort can be improved in practice by taking advantage of the fast running time of insertion sort when its input is “nearly” sorted. When quicksort is called on a subarray with fewer than k elements, let it simply return without sorting the subarray. After the top-level call to quicksort returns, run insertion sort on the entire array to finish the sorting process. Argue that this sorting algorithm runs in O(nk + n lg(n/k)) expected time. How should k be picked, both in theory and in practice by experiments? (40 points) 4. Write code for improved version of sorting algorithm which combines quicksort with insertion sort. (20 points) 5. All document for the answers of the above questions. (20 points)

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
已到末页,全文结束
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有