红桃J

用心写好每行完美的代码,远比写一堆更有价值

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 2 3 4 5 6 7 ··· 15 下一页

2015年6月15日

摘要: 代码: 1 #include 2 #include 3 4 using namespace std; 5 6 void getResult(vector> &result, vector element, vector nums) 7 { 8 if (element.size() == ... 阅读全文
posted @ 2015-06-15 18:46 红桃J 阅读(167) 评论(0) 推荐(0) 编辑

2015年6月11日

摘要: 代码: 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 void swap(char &a, char &b) 8 { 9 char c = a;10 a = b;11 b = c;12 }13 ... 阅读全文
posted @ 2015-06-11 23:42 红桃J 阅读(135) 评论(0) 推荐(0) 编辑

2015年6月7日

摘要: 1 import java.util.*; 2 3 public class MyException extends Exception { 4 5 private static final Exception Exception = null; 6 private stati... 阅读全文
posted @ 2015-06-07 00:05 红桃J 阅读(196) 评论(0) 推荐(0) 编辑

2015年6月6日

摘要: 关于友元这个讲的比较好:http://wuyuans.com/2012/09/cpp-operator-overload/我现在觉得友元就是当时C++之父Bjarne Stroustrup为了给程序员一个偷懒的方式,而引入了友元这种东西。我这次想说的运算符重载是有两个方式的,一种是友元的方式,另一种... 阅读全文
posted @ 2015-06-06 20:22 红桃J 阅读(126) 评论(0) 推荐(0) 编辑

2015年6月4日

摘要: 1 typedef struct Node 2 { 3 int val; 4 string name; 5 bool operator < (const Node &right) const 6 { 7 return val < right.val;... 阅读全文
posted @ 2015-06-04 16:11 红桃J 阅读(500) 评论(0) 推荐(0) 编辑

2015年5月26日

摘要: 进程管理进程的创建、终止、阻塞与唤醒、挂起与激活(条件)信号量机制经典进程同步问题处理机调度与死锁处理机调度的层次调度算法:先来先服务和短作业优先、高优先权优先调度、基于时间片轮转实时调度为什么会产生死锁死锁的处理方法:银行家算法存储器管理存储器的层次结构:程序装入和连接:存储器分配方式:固定分区和... 阅读全文
posted @ 2015-05-26 16:15 红桃J 阅读(161) 评论(0) 推荐(0) 编辑

2015年5月16日

摘要: 无脑写代码代码(TLE): 1 #include 2 #include 3 4 using namespace std; 5 6 int findLeft(int i, vector height) 7 { 8 int t = i-1; 9 while ((t+1= 0)10 ... 阅读全文
posted @ 2015-05-16 16:41 红桃J 阅读(189) 评论(0) 推荐(0) 编辑

摘要: 代码: 1 #include 2 #include 3 4 using namespace std; 5 6 void swap(int &a, int &b) 7 { 8 int c = a; 9 a = b;10 b = c;11 }12 13 int firstMi... 阅读全文
posted @ 2015-05-16 16:17 红桃J 阅读(149) 评论(0) 推荐(0) 编辑

2015年5月15日

摘要: 这个题目其实和之前的没有什么区别,只是添加了21到29这一段更新i的代码。这个题目是说在之前题目的基础上允许candidates集合有相同的元素,那么该剔除相同元素的关键在于发现是什么产生了相同的元素。在回溯时如果我们加入了数字a,最后在退出a的时候,如果下一个数字还是a,那么我把它加进去显然这个子... 阅读全文
posted @ 2015-05-15 10:53 红桃J 阅读(139) 评论(0) 推荐(0) 编辑

2015年5月14日

摘要: 终于搞定了这个DFS,最近这个DFS写的很不顺手,我一直以为递归这种东西只是在解重构时比较麻烦,现在看来,连最简单的返回true和false的逻辑关系都不能说one hundred present 搞定。人品啊TLE: 1 class Solution { 2 public: 3 bool lega... 阅读全文
posted @ 2015-05-14 19:38 红桃J 阅读(169) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 15 下一页