摘要: 一、概述 1、大多数算法都定义在头文件algorithm中;头文件numeric中定义了一组数值泛型算法 2、一般情况下,这些算法并不直接操作容器,而是遍历两个迭代器指定的一个元素范围 算法永远不会改变底层容器的大小,想要改变必须使用容器自带的操作 二、初识泛型算法 1、理解算法最基本的方法是了解他们是否读取元素、改变元素或是重排元素顺序 2、那些只接受一个单一迭代器来作为第二个序列的算法,都假... 阅读全文
posted @ 2015-10-07 20:18 dylqt 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 12], after calling your fun... 阅读全文
posted @ 2015-10-07 16:06 dylqt 阅读(131) 评论(0) 推荐(0) 编辑