摘要: 问题: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra spac 阅读全文
posted @ 2016-09-27 20:24 减掉一斤是一斤 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 题目 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size 阅读全文
posted @ 2016-09-26 17:28 减掉一斤是一斤 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 问题 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transact 阅读全文
posted @ 2016-09-26 16:36 减掉一斤是一斤 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 问题: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size 阅读全文
posted @ 2016-09-26 00:13 减掉一斤是一斤 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 问题: Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. 阅读全文
posted @ 2016-09-25 23:37 减掉一斤是一斤 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that 阅读全文
posted @ 2016-09-25 22:51 减掉一斤是一斤 阅读(116) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: bool containsNearbyDuplicate(vector<int>& nums, int k) { int len=nums.size(); bool flag=false; multimap<int ,int> mulm; for(in 阅读全文
posted @ 2016-09-22 12:15 减掉一斤是一斤 阅读(87) 评论(0) 推荐(0) 编辑
摘要: ap是c++的一个标准容器,她提供了很好一对一的关系,在一些程序中建立一个map可以起到事半功倍的效果,总结了一些map基本简单实用的操作!1. map最基本的构造函数; map<string , int >mapstring; map<int ,string >mapint; map<sring, 阅读全文
posted @ 2016-09-22 11:18 减掉一斤是一斤 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 一、SurfaceSurface就是“表面”的意思。在SDK的文档中,对Surface的描述是这样的:“Handle onto a raw buffer that is being managed by the screen compositor”,翻译成中文就是“由屏幕显示内容合成器(screen... 阅读全文
posted @ 2015-06-03 21:44 减掉一斤是一斤 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 最近要搞一个项目,需要上传相册和拍照的图片,不负所望,终于完成了! 不过需要说明一下,其实网上很多教程拍照的图片,都是缩略图不是很清晰,所以需要在调用照相机的时候,事先生成一个地址,用于标识拍照的图片URI具体上传代码:1.选择图片和上传界面,包括上传完成和异常的回调监听[java]view pla... 阅读全文
posted @ 2015-05-28 23:33 减掉一斤是一斤 阅读(862) 评论(0) 推荐(0) 编辑