中国高校课件下载中心 》 教学资源 》 大学文库

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

文档信息
资源类别:文库
文档格式:PDF
文档页数:1
文件大小:8.5KB
团购合买:点击进入团购
内容简介
复旦大学:《数据结构与算法设计》综合项目_Project1. Combining quicksort with insertion sort
刷新页面文档预览

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)

已到末页,全文结束
刷新页面下载完整文档
VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
相关文档