Princeton Algorithms: Part 2 [week 7: Final Exam Part II]
来源:互联网 发布:程序员个人简介 编辑:程序博客网 时间:2024/06/05 08:26
Question Explanation
The correct answer is: 0 2 3 2 1 1 1 3 4
0: Original input
2: MSD radix sort after the first call to key-indexed counting
3: 3-way radix quicksort after the first partitioning step
2: MSD radix sort after the second call to key-indexed counting
1: LSD radix sort after 3 passes
1: LSD radix sort after 1 pass
1: LSD radix sort after 2 passes
3: 3-way radix quicksort after the second partitioning step
4: Sorted
Question Explanation
The correct answer is: A B B C D C D D
Below are the sorted cyclic suffixes and the next[] array:
i suffixes[i] t next[i]
-----------------------------
* 0 A ? ? ? ? ? ? D 1
1 B ? ? ? ? ? ? A 2
2 B ? ? ? ? ? ? B 3
3 C ? ? ? ? ? ? B 6
4 C ? ? ? ? ? ? D 7
5 D ? ? ? ? ? ? D 0
6 D ? ? ? ? ? ? C 4
7 D ? ? ? ? ? ? C 5
Since first = 0, the first character is A (the first character in row 0).
Since next[0] = 1, the second character is B (the first character in row 1).
Since next[next[0]] = 2, the third character is B (the first character in row 2).
Since next[next[next[0]]] = 3, the fourth character is C (the first character in row 3).
0 0
- Princeton Algorithms: Part 2 [week 7: Final Exam Part II]
- Princeton Algorithms: Part 2 [week 7: Reductions]
- Princeton Algorithms: Part 2 [week 7: Intractability]
- Princeton Algorithms: Part 1 [Final Exam Part I]
- Princeton Algorithms: Part 2 [week 5: Tries]
- Princeton Algorithms: Part 2 [week 7: Linear Programming]
- Week 1 Assignment - Wordnet - Princeton - Algorithms Part II
- Princeton Algorithms: Part 2 [week 2: Minimum Spanning Trees]
- Princeton Algorithms: Part 2 [week 2: Shortest Paths]
- Princeton Algorithms: Part 1 [week 2:Stacks and Queues]
- Princeton Algorithms: Part 1 [week 2:Elementary Sorts]
- Princeton Algorithms: Part 2 [week 1: Undirected Graphs]
- Princeton Algorithms: Part 2 [week 1: Directed Graphs]
- Princeton Algorithms: Part 2 [week 3: Maxflow and Mincut]
- Princeton Algorithms: Part 2 [week 3: Radix Sorts]
- Princeton Algorithms: Part 2 [week 5: Substring Search]
- Princeton Algorithms: Part 2 [week 6: Regular Expressions]
- Princeton Algorithms: Part 2 [week 6: Data Compression]
- Android进入本地文件管理器及不同文件查看
- YII2 GridView联表搜索,排序
- Mac环境下服务器环境搭建
- 使用fiddler抓安卓APP数据包并调试PHP程序
- Android textView字体自定义结合HTml
- Princeton Algorithms: Part 2 [week 7: Final Exam Part II]
- PHP控制中奖概率的抽奖算法
- 获取对象中字段的get和set方法
- Magento添加Facebook/Pinterest open graph meta,Google商店Feed
- 单向链表是否有交点以及查找交点
- Mnesia数据库集群(基础)
- MyEclipse中创建WEB工程,运用<img>标签显示图片等,但无法显示问题
- jqgrid 静态树
- flahs释放内存