随笔分类 -  找工作面试

摘要:#include<iostream>#include<vector>#include<algorithm>#include<stdint.h>using namespace std;#include<list>#include<map>#include<queue>struct node{ int 阅读全文
posted @ 2016-07-11 20:28 simple_wxl 阅读(346) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<vector>#include<algorithm>#include<stdint.h>using namespace std;#include<list>#include<map>#include<queue> struct TreeNode 阅读全文
posted @ 2016-07-05 11:57 simple_wxl 阅读(144) 评论(0) 推荐(0) 编辑
摘要:/** * Definition of TreeNode: * class TreeNode { * public: * int val; * TreeNode *left, *right; * TreeNode(int val) { * this->val = val; * this->left = this->right... 阅读全文
posted @ 2016-07-04 21:14 simple_wxl 阅读(1354) 评论(0) 推荐(0) 编辑
摘要:来源:http://hxraid.iteye.com/blog/649831 题目:在一个文件中有 10G 个整数,乱序排列,要求找出中位数。内存限制为 2G。只写出思路即可(内存限制为 2G的意思就是,可以使用2G的空间来运行程序,而不考虑这台机器上的其他软件的占用内存)。 分析: 既然要找中位数 阅读全文
posted @ 2016-07-03 22:25 simple_wxl 阅读(2009) 评论(2) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-07-03 21:28 simple_wxl 阅读(130) 评论(0) 推荐(0) 编辑
摘要:list是双向链表,map保存key对应到list中的迭代器的位置,list保存<key,value> 阅读全文
posted @ 2016-07-03 15:47 simple_wxl 阅读(264) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<vector>#include<queue>#include<string>#include<map>using namespace std;struct node{ int val; node * left,*right; node(int _ 阅读全文
posted @ 2016-07-02 23:13 simple_wxl 阅读(146) 评论(0) 推荐(0) 编辑
摘要:int getposition(int arr[],int left,int right) { int tmp=arr[left]; while(left<right) { while(left<right&&arr[right]>=tmp) right--; arr[left]=arr[right 阅读全文
posted @ 2016-07-02 17:04 simple_wxl 阅读(157) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<stack>#include<vector>using namespace std;struct node{ int val; node *left,*right; node(int _val):val(_val),left(NULL),righ 阅读全文
posted @ 2016-06-30 15:29 simple_wxl 阅读(295) 评论(0) 推荐(0) 编辑
摘要:最朴素的做法o(V*V/2+2E)~O(V^2)#include<iostream>using namespace std;#include<vector>#include<algorithm>#include<string>#include<string.h>const int MAX = 200 阅读全文
posted @ 2016-06-28 22:28 simple_wxl 阅读(205) 评论(0) 推荐(0) 编辑
摘要:KMP的子串长n,模式串长m,复杂度o(m+n),朴素做法的复杂度o((n-m+1)*m) 觉得大话数据结果上面这个讲得特别好 改进版本的KMP leetcode 28. Implement strStr() 28. Implement strStr() 阅读全文
posted @ 2016-06-28 21:18 simple_wxl 阅读(495) 评论(0) 推荐(0) 编辑
摘要:hive中的各种join操作 join是最简单的关联操作,两边关联只取交集。 outer join分为left outer join、right outer join和full outer join。 left outer join是以左表驱动,右表不存在的key均赋值为null; right ou 阅读全文
posted @ 2016-06-27 22:40 simple_wxl 阅读(356) 评论(0) 推荐(0) 编辑
摘要:1、引用和指针的区别 1)引用被创建的时候需要初始化,指针可以等到任何时候再初始化 2)引用不能指向NULL,指针可以指向NULL 3) 引用被初始化后,不能再绑定到其它对象,而指针初始化后,可以改变他指向的对象 对于第3条的理解: int m=90; int &n=m; int b=99; n=b 阅读全文
posted @ 2016-06-26 15:39 simple_wxl 阅读(286) 评论(0) 推荐(0) 编辑