Princeton Algorithms: Part 1 [week 3: Quicksort]
来源:互联网 发布:java gui编程教程 编辑:程序博客网 时间:2024/04/30 03:24
Exercises
Explanation:
The correct answer is: 26 15 32 39 41 64 91 67 53 90 78 49
Here is the array before and after each exchange:
i j 0 1 2 3 4 5 6 7 8 9 10 11
--------------------------------------------------------
0 12 41 49 90 91 26 64 39 67 53 32 78 15
1 11 41 49 90 91 26 64 39 67 53 32 78 15
1 11 41 15 90 91 26 64 39 67 53 32 78 49
2 9 41 15 90 91 26 64 39 67 53 32 78 49
2 9 41 15 32 91 26 64 39 67 53 90 78 49
3 6 41 15 32 91 26 64 39 67 53 90 78 49
3 6 41 15 32 39 26 64 91 67 53 90 78 49
5 4 26 15 32 39 41 64 91 67 53 90 78 49
4 26 15 32 39 41 64 91 67 53 90 78 49
Explanation:
The correct answer is: 24 55 26 54 57 57 57 57 83 61
Here is the array after each iteration:
lt i gt 0 1 2 3 4 5 6 7 8 9
----------------------------------------------------
0 0 9 57 24 61 55 26 57 57 54 83 57
0 1 9 57 24 61 55 26 57 57 54 83 57
1 2 9 24 57 61 55 26 57 57 54 83 57
1 2 8 24 57 57 55 26 57 57 54 83 61
1 3 8 24 57 57 55 26 57 57 54 83 61
2 4 8 24 55 57 57 26 57 57 54 83 61
3 5 8 24 55 26 57 57 57 57 54 83 61
3 6 8 24 55 26 57 57 57 57 54 83 61
3 7 8 24 55 26 57 57 57 57 54 83 61
4 8 8 24 55 26 54 57 57 57 57 83 61
4 8 7 24 55 26 54 57 57 57 57 83 61
4 7 24 55 26 54 57 57 57 57 83 61
Job Interview Questions
paper: http://www.cs.ucla.edu/~rafail/PUBLIC/17.pdf
0 0
- Princeton Algorithms: Part 1 [week 3: Quicksort]
- Princeton Algorithms: Part 1 [week 3:Mergesort]
- Princeton Algorithms: Part 1 [week 1:Analysis of Algorithms]
- Princeton Algorithms: Part 1 [week 1:Union Find]
- Princeton Algorithms: Part 2 [week 3: Maxflow and Mincut]
- Princeton Algorithms: Part 2 [week 3: Radix Sorts]
- Week 1 Assignment - Wordnet - Princeton - Algorithms Part II
- Princeton Algorithms: Part 1 [week 2:Stacks and Queues]
- Princeton Algorithms: Part 1 [week 2:Elementary Sorts]
- Princeton Algorithms: Part 1 [week 4: Priority Queues]
- Princeton Algorithms: Part 1 [week 4: Binary Search Trees]
- Princeton Algorithms: Part 1 [week 5: Balanced Search Trees]
- Princeton Algorithms: Part 1 [week 6: Hash Tables]
- 【Java、算法】Princeton Algorithms Part I Week 1 Exercise
- Princeton Algorithms: Part 2 [week 1: Undirected Graphs]
- Princeton Algorithms: Part 2 [week 1: Directed Graphs]
- Princeton Algorithms: Part 2 [week 5: Tries]
- Princeton Algorithms: Part 2 [week 7: Reductions]
- PB数据窗口对象之显示样式
- Myeclipse连接mysql数据库(给力的写)全程心得)
- 关于SQLite与SQLServer的区别
- Java获取.properties文件
- linux程序编译期加入编译时间和svn版本号
- Princeton Algorithms: Part 1 [week 3: Quicksort]
- mtk的一道面试题
- SQL的SubQuery
- P2P网贷黎明前夕的黑夜---P2P是否要被封杀呢
- vs引入新lib-----附cocos2dx3.0 http通信lib库添加
- libGDX视频教程(八) -- 演员类(一)
- SSH web开发笔记1(proxool配置)
- 排序算法之快速排序
- 关于s3c6410的SD卡启动