- 博客(19)
- 资源 (3)
- 收藏
- 关注
原创 一点自我反省
发现自己真的很弱,越来越感到自己的不足,过去的大学三年半我也不知道是怎么漫无目的地度过去的,幸运的是现在反省还不完,你还有机会去努力!写代码的能力还是不足,C++ 只会基本的语法,平时代码写的有点少了,以后要多看多写代码。没事就刷刷csdn、知乎,刷点有营养的内容
2014-12-21 22:36:11
511
原创 约瑟夫环问题
虽然很简单#includeusing namespace std;int circle[100];void josefu(int m, int p){ int count = 0; int step = 0; int call = 0; int j = 0; memset(circle, 0, 100); while (count < m) { call =
2014-09-20 18:04:10
572
原创 Populating Next Right Pointers in each Node
http://leetcode.com/2010/03/first-on-site-technical-interview.html这代码简直酷炫啊
2014-09-05 14:53:04
507
原创 Linked List Cycle
先贴代码class Solution {public: bool hasCycle(ListNode *head) { bool flag=false; ListNode * p; ListNode * q; if(head==NULL) return false;
2014-09-05 11:13:14
481
原创 unique binary search trees
class Solution {public:int trees(int x,int y){ int way = 1; if (x<y) { way = 0; for (int i = x; i <=y; i++) { way += trees(x, i-1) * trees(i+1, y); } } return way;} int numTr
2014-09-05 10:39:06
465
原创 const 与 static
static作用:1限制范围(函数,变量只能在本文件中使用) 2设定变量存储区域(静态存储区域) const作用:声明常量,它不能被修改,它存放在常量区附上百度百科
2014-08-28 20:30:57
488
原创 康托编码
n个数的全排列,按照从下到大的顺序排列,问第k个位置的数是多少? 这个问题有几种方法,不过只有康托编码的时间复杂度是最低的。是O(n),简直凶残。 1.用next_permutation来求,这个也是leetcode上的一道题,就是求其下一个排列,然后对1234…n 运行n次 next_pernutation方法就能得到第k个数了 思想就是这样。 2.利用康托编码来求。 其实就是康
2014-08-28 19:04:59
4498
编译原理编译器
2015-01-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人