算法导论(CLRS, 2nd) 个人答案 Ch1

本文探讨了算法在不同场景的应用,包括学生排名、矩阵乘法、凸包查找等,并对比了全对最短路径(APSP)与旅行商问题(TSP)的区别。此外还介绍了随机算法在音乐播放器中的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.1-1

Sorting: rank the student's according to the score

Determining the best order for multiplying matrices: When doing  probability calculation, one may require lots of matrices  multiplication for the cumulative probability results

Finding the convex hull:

1.1-2

Space

1.1-3

Linked list:

Strength: can be used for chaining

Weakness: O(n) time for random access

1.1-4:

Similarity: both about gaining the best solution

Difference: APSP (all pair shortest path) only involves in one  parameter -- the cost; while TSP (travelling salesman) is about  gaining the maximum profit under limited resource

1.1-5:

Only Best Solution Will Do: find the k-th solution from an n- element table; look-up time should be 1.

Approximately the best can do: find a good route to travel all  over the world

1.2-1:

Application: music player -- random play (Function of the  Algorithm involved)

Require random algorithm to randomize an array of numbers

 

1.2-2:

2011052811294573.png

1.2-3:

2011052811304632.png

转载于:https://www.cnblogs.com/flyfy1/archive/2011/05/28/2060602.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值