会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
qingcheng奕
公告
日历
导航
博客园
首页
新随笔
新文章
联系
订阅
管理
2014年10月13日
LeetCode OJ-- Single Number II **@
摘要: 有一列数,其中有1个数出现了1次,其它数都出现了3次,求这个数。class Solution {public: int singleNumber(int A[], int n) { if(n > i & 1; q = (q + p ) % 3; ...
阅读全文
posted @ 2014-10-13 10:56 qingcheng奕
阅读(129)
评论(0)
推荐(0)
编辑
2014年9月11日
python subprocess 自动运行实验室程序
摘要: import threading, os, subprocess, timeexec_path = "/home/xhz/gems/ruby/amd...../bin/tester.exec"out_data_path = "/home/xhz/...generated/"max_process =...
阅读全文
posted @ 2014-09-11 17:19 qingcheng奕
阅读(732)
评论(0)
推荐(0)
编辑
2014年9月6日
LeetCode OJ-- 二战 Combinations
摘要: 在1 - 10 中,求出 7 个数的排列组合。出现了超时,而超时的原因是有好多重复情况,复杂度上来说,和答案的复杂度是一样的,但是答案中重复了太多了,体会下。超时1:class Solution {public: vector > combine(int n, int k) { ...
阅读全文
posted @ 2014-09-06 21:37 qingcheng奕
阅读(161)
评论(0)
推荐(0)
编辑
LeetCode OJ-- 二战 Palindrome Number
摘要: 判断一个 int 是否为回文的有一点要注意的是:int x;int _x = abs(x);对 x 取绝对值的时候,会发生溢出。比如 x = INT_MIN 即 -2147483648 而 INT_MAX 为2147483647其实,负数不是回文数
阅读全文
posted @ 2014-09-06 20:29 qingcheng奕
阅读(105)
评论(0)
推荐(0)
编辑
2014年9月3日
Cracking-- 17.13 将二叉树转换成双向链表
摘要: 在书的105页使用中根遍历的思想left 之后 为 root 之后 为 right则对左子树来说left->right = root;root->left = left;对右子树来说root->right = right-> -> -> left;left->left 为根的根 的根而right-...
阅读全文
posted @ 2014-09-03 19:36 qingcheng奕
阅读(210)
评论(0)
推荐(0)
编辑
2014年8月22日
Cracking-- 4.7 在一颗二叉树中找两个节点的第一个共同祖先
摘要: 分别记录从 root 到 node1 的path 到 node2的path,再找其中共同的部分struct Node{ int val; struct Node *left; struct Node *right; Node(int _val) { val...
阅读全文
posted @ 2014-08-22 16:16 qingcheng奕
阅读(184)
评论(0)
推荐(0)
编辑
2014年8月21日
priority_queue 示例
摘要: http://www.cplusplus.com/reference/queue/priority_queue/priority_queue 的top始终保持着为一堆数据中的最大元素。读取最小 O(1)插入和删除 lg(n)(真是又简便又好用,难怪g不要我,当时连这个都不会写,sigh...)#in...
阅读全文
posted @ 2014-08-21 10:52 qingcheng奕
阅读(238)
评论(1)
推荐(0)
编辑
heap c++ 操作 大顶堆、小顶堆
摘要: 在C++中,虽然堆不像 vector, set 之类的有已经实现的数据结构,但是在 algorithm.h 中实现了一些相关的模板函数。下面是一些示例应用http://www.cplusplus.com/reference/algorithm/pop_heap/#include #include ...
阅读全文
posted @ 2014-08-21 09:58 qingcheng奕
阅读(8513)
评论(0)
推荐(1)
编辑
2014年8月20日
【转】当你在浏览器地址栏输入一个URL后回车,将会发生的事情?
摘要: http://igoro.com/archive/what-really-happens-when-you-navigate-to-a-url/http://www.cnblogs.com/panxueji/archive/2013/05/12/3073924.html作为一个软件开发者,你一定会对...
阅读全文
posted @ 2014-08-20 11:38 qingcheng奕
阅读(230)
评论(0)
推荐(1)
编辑
2014年8月19日
Cracking-- 1.1 判断字符串中是否有重复字符
摘要: 第三种方法为位运算的方法。位运算符: #include #include #include #include using namespace std;//时间 O(n) 空间 O(1)bool hasSame(string str){ if(str.size() == 0 ) r...
阅读全文
posted @ 2014-08-19 11:26 qingcheng奕
阅读(240)
评论(0)
推荐(0)
编辑
下一页
Copyright © 2025 qingcheng奕
Powered by .NET 9.0 on Kubernetes
点击右上角即可分享