自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 收藏
  • 关注

原创 CentOS6.5 U盘安装(解决了FAT32格式造成的不能复制iso文件至U盘根目录问题)

本人安装过程遇见了上述标题中的问题,百度之google之,发现大部分人都直接说出了再遇到image找不到的解决方案是将iso整个文件在放置到刻录好的U盘的根目录下,但是正如http://blog.sina.com.cn/s/blog_51c1ed0501018lf2.html 下面的留言一样,都没法完成iso文件的复制问题。在此本人瞎捣鼓了一下午,貌似是解决了这个问题,还望各位大侠实验之

2014-01-01 18:41:37 8278

原创 leetcode sum from root to leaf

Just the code. This is a very easy one. Using DFS ALG /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : va

2015-01-04 01:27:21 564

原创 leetcode surronded region

#include #include #include using namespace std; class Solution { public: int** visited; int *circle_r, *circle_c; int st, ed, row, col; void solve(vector > &board) { int

2015-01-04 01:24:25 759

原创 leetcode word break I && II

Two dynamic programming problem problem II can use the code of problem I Word Break I class Solution { public: int longestWord(unordered_set dict) { unordered_set::iterator it;

2015-01-02 16:13:05 814

原创 leetcode Palindrome I and II comparison

The easier one "Palindrome I" is solved by DFS ALG 1. From left to right, judge the substr(0, i) is Palindrome or not. If it is, add it to one of the element of the answer. Then use partition to find

2015-01-02 09:58:08 541

原创 leetcode Unique BST

总结一下这题:碰到这种计数问题应该本能想到用dynamic programming的思路 又正好是关于tree的问题,所以应该先想到左子树的结果与右子树的结果的某种操作,这道题正好应该选择乘法操作 class Solution { public: // DFS method int *lookup; int numTrees(int n) { // re

2014-12-23 14:11:35 622

原创 leetcode validate binary search tree

一道Easy级别的题目 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than 

2014-12-23 09:16:54 579

原创 leetcode Majority Element

这题限制时间复杂度是O(n) 才能通过所有测试,之前写了一个现sorting的,复杂度是O(nlogn),Time Limited Exceed!!! 网上看到一个很赞的算法Moore voting algorithm, Stackoverflow 上有很好的解释 class Solution { public: int majorityElement(vector &nu

2014-12-23 08:19:40 938

原创 leetcode Binary Tree Upside Down

/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class So

2014-12-22 14:00:19 762

原创 leetcode Read N Characters Given Read4

// Forward declaration of the read4 API. int read4(char *buf); class Solution { public: /** * @param buf Destination buffer * @param n Maximum number of characters to read * @ret

2014-12-22 13:51:47 1056

原创 leetcode Find minimum in rotated sorted array

Just the following code for both duplicated or not.

2014-11-12 07:02:41 681

原创 leetcode Min stack

It is very easy to get idea of this problem. Just use an auxiliary stack (s_a) to store the current minimum element in the data stack (s_d). But leetcode has a strong constrain in the memory size, alw

2014-11-11 02:53:15 665

原创 最简单配置方法!无线网络联网状态下 VirtualBox实现Window主机与虚拟机互相访问

网上关于VirtualBox的帖子实在是

2014-05-27 21:03:22 8835

原创 LRU leetcode 代码实现

很奇怪,我自己明明能跑得通的程序放在leetcode上面测试会出现Runtime

2014-04-21 01:46:21 1009

转载 Xen bridge 超详细远离说明

类似VMware,Xen提供了几种不同的网络连接方式,主要有桥接模式,NAT模式,路由模式。其中最常用的,也是Xen默认安装的方式就是桥接模式。   在桥接模式下,Xen会创建了一个网桥,并且把服务器上的物理网卡接口加入到这个网桥中。之后,Xen会把dom0和其他domU的虚拟网卡接口也加入到这个网桥中来。这样在这个网桥之内的所有domU在网桥内部可以互相通讯,另外还可以通过网桥中的物

2014-02-19 14:46:13 1055

原创 python简单易懂的全排列实现

b = [0,0,0,0,0,0,0] %临时变量,记录每一种排序的可能性 count = 0 %记录当前排列到第几位 c = [] %全局变量记录下所有的排列情况 def full_array(a): global b,count,c if len(a) == 1: b[count] = a[0] c.append(b) retu

2013-07-15 10:49:03 1016

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除