算法练习(109): 选择排序复杂度(2.1.3)

本系列博客习题来自《算法(第四版)》,算是本人的读书笔记,如果有人在读这本书的,欢迎大家多多交流。

算法(第4版)

知识点

  • 选择排序复杂度

题目

2.1.3 构造一个含有 N 个元素的数组,使选择排序(算法 2.1)运行过程中 a[j] < a[min] (由此 min 会不断更新)成功的次数最大。


2.1.3 Give an example of an array of N items that maximizes the number of times the test a[j] < a[min] fails (and, therefore, min gets updated) during the operation of selection sort (Algorithm 2.1).

广告

我的首款个人开发的APP壁纸宝贝上线了,欢迎大家下载。

你可能感兴趣的:(算法练习(109): 选择排序复杂度(2.1.3))