摘要: 函数功能 :指向序列之中数组最大元素,包含在algorithm库中。 函数返回迭代器,时间复杂度O(n)。 版本一 运用实例: "Leetcode 969. Pancake Sorting" 参考书籍 : 《STL源码剖析》 阅读全文
posted @ 2019-01-07 20:38 我的小叮当 阅读(1811) 评论(0) 推荐(0) 编辑
摘要: 函数功能 :将序列[first,last)的元素在原容器中颠倒重排,包含在algorithm库中。 reverse()函数无返回值,时间复杂度O(n)。 可以看到函数中是last是先减一。应当理解的是vector.end()是指向数组最后一个元素后面的位置。 reverse(v.begin(), v 阅读全文
posted @ 2019-01-07 20:09 我的小叮当 阅读(893) 评论(0) 推荐(0) 编辑
摘要: 题目 链接: "https://leetcode.com/problems/pancake sorting/" Level: Medium Discription: Given an array A, we can perform a pancake flip: We choose some pos 阅读全文
posted @ 2019-01-07 19:45 我的小叮当 阅读(537) 评论(0) 推荐(0) 编辑