新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     >>计算机科学论坛<<     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 研友的交流园地,讨论关于计算机考研的方方面面。
    [返回] 计算机科学论坛计算机理论与工程『 计算机考研交流 』 → 问一道算法分析题 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 4161 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 问一道算法分析题 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     yapi 帅哥哟,离线,有人找我吗?处女座1983-9-9
      
      
      等级:大一(高数修炼中)
      文章:27
      积分:187
      门派:XML.ORG.CN
      注册:2006/4/11

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给yapi发送一个短消息 把yapi加入好友 查看yapi的个人资料 搜索yapi在『 计算机考研交流 』 的所有贴子 引用回复这个贴子 回复这个贴子 查看yapi的博客楼主
    发贴心情 问一道算法分析题

    c,d两问如何搞呢
    我做到 nk*c1+nlg(n/k)*c2=nlgn*c2
             c1*k=c2*lgk 就把n给消掉了
             后面不知该怎么推了
             k应当是一个与n相关的量吧
    原题如下:
    Problems 2-1: Insertion sort on small arrays in merge sort

    Although merge sort runs in Θ(n lg n) worst-case time and insertion sort runs in Θ(n) worst-
    case time, the constant factors in insertion sort make it faster for small n. Thus, it makes sense
    to use insertion sort within merge sort when subproblems become sufficiently small. Consider
    a modification to merge sort in which n/k sublists of length k are sorted using insertion sort
    and then merged using the standard merging mechanism, where k is a value to be determined.

    a. Show that the n/k sublists, each of length k, can be sorted by insertion sort in Θ(nk)
    worst-case time.
    b. Show that the sublists can be merged in Θ(n lg (n/k) worst-case time.
    c. Given that the modified algorithm runs in Θ(nk + n lg (n/k)) worst-case time, what is
    the largest asymptotic (Θnotation) value of k as a function of n for which the modified
    algorithm has the same asymptotic running time as standard merge sort?
    d. How should k be chosen in practice?


       收藏   分享  
    顶(0)
      




    ----------------------------------------------
    宁静以致远,淡薄以铭志

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/6/26 20:57:00
     
     GoogleAdSense处女座1983-9-9
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 计算机考研交流 』 的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/4/20 7:05:33

    本主题贴数1,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    48.828ms