- 博客(10)
- 资源 (8)
- 问答 (1)
- 收藏
- 关注
原创 341. Flatten Nested List Iterator
/** * // This is the interface that allows for creating nested lists. * // You should not implement it, or speculate about its implementation * class NestedInteger { * public: * // Return t
2016-04-28 15:54:57 619
原创 343. Integer Break
分析找规律:n : 2 3 4 5 6 7 8 9 10 11返回值: 1 2 2×2 2×3 3×3 2×2×3 2×3×3 3×3×3 2×2×3×3 2×3×3×3程序如下:class Solution {public: int integerBreak(int n) {//给定不小于2的正数n,
2016-04-28 12:11:46 453
原创 345. Reverse Vowels of a String
本题关键在于找到字符串中的元音字母,用i,j从字符串首尾向中间遍历,遇到元音字母时交换,直到i>=j结束。代码:class Solution {//英文字母中的元音字母有 a,e,i,o,u.public:int check(char c){ string S="aeiou"; return (string("")+c).find_first_o
2016-04-28 11:07:21 495
原创 121. Best Time to Buy and Sell Stock(只允许一次交易)
我的算法运行时间较长:代码如下:class Solution {public: int maxP(vector& prices,int left,int right){ if(left==right)return 0; int i=left,j=left,max,min; max=min=prices[left];
2016-04-27 22:20:27 367
原创 344. Reverse String
class Solution {public: string reverseString(string s) { string temp; for(int i=0;i<s.size();i++){ temp.insert((std::string::size_type)0,1,s[i]); } ret
2016-04-27 21:37:34 247
原创 读数序列: 1,11,21,1211,111221,312211
说数序列从 1 开始,然后开始读:1 读为: 1个1,提取数字11(即为第二个数);11 读为: 2个1,提取数字21(即为第三个数);21 读为: 1个2、1个1,提取数字1211(即为第四个数);1211 读为:1个1、1个2、2个1;提取数字111221(即为第四个数);……编程计算第n个读数序列中的数字串,用字符串表示:
2016-04-16 12:48:30 7356
原创 38. Count and Say
我的答案:class Solution {public:string vTs(vector<int> v){//保存整数的向量序列,转化为字符串序列 string s; auto it=v.begin(); while(it!=v.end()){ const char c=*it+'0'; s.push_back(c); ++it; } return s;} string countAndSay(int
2016-04-16 12:30:08 309
原创 小程序:删除单链表中倒数第n个结点
#include#include#include #includeusing namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; ListNode* removeNthFromEnd(Li
2016-04-12 22:24:36 605
原创 19. Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the
2016-04-12 22:20:13 274
原创 如何用3DMAX导出.X文件
由于最近在学习DirectX,获知可将普通建模软件(如3d max、maya、LightWave)生成的网格模型导出为.X文件格式,便查了查,.X是DirectX定义的格式,这样便可以用3d max可视化建立网格模型,导出.X文件,然后用D3DX库直接编程了!首先说明,3d max 本身没有这种导出格式,要想用3d max导出.X文件,需要插件。步骤如下:1. 下载Dire
2016-04-01 21:37:42 11431
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关注的人