- 博客(11)
- 资源 (8)
- 问答 (1)
- 收藏
- 关注
原创 cin.get()与cin.getline()函数讲解1
先简单说明几个语句:char s[20]; cin.get(s,20,'m'); //最后一个参数可采用默认值'\n',用法cin.get(s,20)此句从输入流中提取字符给s,第二个参数表示数组大小,第三个参数是终止字符(默认参数值'\n')。函数遇到以下任何一个条件都会终止:1.当输入流中提取到字符'm'; 2.已从输入流中提取了(20-1)个字符。cin.
2016-02-29 21:34:13 1937
原创 git 是什么玩意儿? git基本命令
首先,你为什么需要用git? 如果你有过这样类似的经历: 某天建了一个文件,名叫“代码.doc",过几天,有了"代码修改版2.doc",“代码修改版3.doc”,甚至,“代码最终版.doc”,“代码最终版2.doc”…… 最后你根本就记不起来到底这些个版本之间都有什么区别!?想删不敢删,想汇合代码又太长太多。。。 或者,你曾经疑惑过
2016-02-29 19:50:22 895
原创 88. Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 intonums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal tom + n) to hold addit
2016-02-20 11:19:55 277
原创 栈stack和队列queue的常用基本函数
stack s; //定义一个名为s,保存整形元素的栈s.push(i); //元素i入栈s.pop(); //删除栈顶元素s.top(); //返回栈顶元素s.empty(); //判断栈是否为空,空则返回trues.size(); //返回栈中包含的元素个数queue q; //定义一个名为q, 保存整形元素的队列q.push(i
2016-02-18 23:42:09 549
原创 225. Implement Stack using Queues 用两个队列实现栈的基本操作。
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return whet
2016-02-18 23:25:45 351
原创 9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.解题思想:求得x的最高位,与x最低位比较。我的代码:class Solution {public: bool isPalindrome(int x) { if(x<0)return false;
2016-02-18 22:54:42 189
原创 119. Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?C++代码:class
2016-02-17 21:11:34 713
原创 172. Factorial Trailing Zeroes详细解答
Given an integer n, return the number of trailing zeroes inn!. 给定整数n,求n!末尾有几个零。Note: Your solution should be in logarithmic time complexity. 解题方法必须是log数级的时间复杂度(即不能直接求n!的值)解题思路:(关键在于找到n与n
2016-02-17 20:45:28 563
原创 118. Pascal's Triangle
Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]解题思路:用row1保存上一行向量,row
2016-02-17 19:30:27 236
原创 198. House Robber(C++实现)
动态规划求解,设n-2座房子最多能抢到f(n-2),n-1座房子能最多抢到f(n-1),n座房子最多能抢f(n),最后一座房子里有nMoney,则可以推导出他们之间的关系(分两种情况,第一种不抢最后一座房子得到收益f(n)=f(n-1);第二种抢最后一座房子得到收益是f(n)=f(n-2)+nMoney;显然抢钱者会选择最大收益!即f(n)=max{f(n-1),f(n-2)+nMoney}.
2016-02-16 20:31:11 554
原创 101. Symmetric Tree 对称树,递归算法
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the following
2016-02-16 19:14:13 573
Release版64位gdal动态链接库
2017-11-20
gdal动态链接库(64位Release版)
2017-11-20
VC ++编程指南
2015-01-01
使用vs2013编译64位的gdal源码
2017-09-26
TA创建的收藏夹 TA关注的收藏夹
TA关注的人