上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 69 下一页
摘要: /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Solution {public: bool Less(TreeNode *root, int data) { if(root == NULL) return true; ... 阅读全文
posted @ 2014-04-08 22:45 jihite 阅读(588) 评论(0) 推荐(0)
摘要: 分析根结点固定时平衡二叉树个数=左孩子的个数 * 右孩子的个数。又左孩子或右孩子为空是不妨置为1,这样0个结点时,f(0) = 11个结点时,f(1) = f(0) * f(0) = 12个结点时,f(2) = f(0) * f(1) + f(1) * f(0)3个结点时,f(3) = f(0) *... 阅读全文
posted @ 2014-04-08 21:24 jihite 阅读(306) 评论(0) 推荐(0)
摘要: Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2014-04-06 22:28 jihite 阅读(445) 评论(0) 推荐(0)
摘要: http://blog.csdn.net/wfdtxz/article/details/7368357 阅读全文
posted @ 2014-04-06 10:38 jihite 阅读(431) 评论(0) 推荐(0)
摘要: 题目大意给出一个单链表,和一个K值,根据K值往右旋转,例如:思路先求出链表的长度size,其实按着倒数第K%size个位置旋转,这个位置即size-(K%size)参考代码/** * Definition for singly-linked list. * struct ListNode { * ... 阅读全文
posted @ 2014-04-05 22:40 jihite 阅读(1182) 评论(0) 推荐(0)
摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?思路两个指针。一个每次走一步,另一个每次走两步,如果有环,会相遇。/** * Def... 阅读全文
posted @ 2014-04-04 22:26 jihite 阅读(288) 评论(0) 推荐(0)
摘要: 图示算法描述把待排序序列分为若干个有序的子序列,再把有序的子序列合并为整体有序序列申请空间,使其大小为两个已经排好序的数组的长度之和把两个有序的数组通过比较桉顺序放到申请的空间中把在申请空间上存放的元素复制到原数组相应的位置上参考代码void merge(int *a, int beg, int m... 阅读全文
posted @ 2014-04-03 22:45 jihite 阅读(485) 评论(0) 推荐(0)
摘要: 原码 反码 补码 右移一位 结果(原码)-1 = 1000 0001, 1111 1110, 1111 1111, 1111 1111 -1-2 = 1000 0010, 1111 1101, 1111 1110, 1111 1111 -1-3 = 1000 0011, 1111 1100, 1111 1101, 1111 1110 -2-4 = 1000 0100, 1111 1011, 1111 1100, 1111 1110 -2-5 = 1000 0101, 1111 1010,... 阅读全文
posted @ 2014-04-03 10:08 jihite 阅读(3460) 评论(0) 推荐(0)
摘要: #include #include #includeusing namespace std;int i = 3;int main(){ setlocale(LC_ALL, "zh_CN.UTF-8"); wchar_t a[] = L"你好"; wcout << a << endl; } 阅读全文
posted @ 2014-04-02 21:59 jihite 阅读(1143) 评论(0) 推荐(0)
摘要: 什么是奶酪?稳定的工作、身心的健康、和谐的人际关系、甜蜜美满的爱情,活着令人充满想象的财富......墙上格言如果不改变,你就会被淘汰。经常嗅一嗅奶酪,这样你才知道他是否依旧新鲜。朝着新的方向前进,你就会发现新的奶酪。当你克服了恐惧,你就会感到轻松自在。想象自己正在拥有奶酪,这样可以帮助你找到新的奶酪。你越快放弃旧的奶酪,你就可以越早享受新的奶酪。在迷茫中搜寻总比停留在没有奶酪的地方更有保障。抛弃旧的观念,才能找到新的奶酪。只要相信自己能够并且找到新的奶酪,你就会改变自己的行为。及早注意细微小变化,这会有助于你适应即将来的大变化。我感觉对我印象最深的一句话改变自己最快捷的方式就是嘲笑自己的愚蠢 阅读全文
posted @ 2014-03-30 22:33 jihite 阅读(618) 评论(0) 推荐(1)
上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 69 下一页