自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Textbook Ex.8.22

a) 显然 FAS 是可在多项式时间内验证的,因此属于NP。 b) 设G 的一个大小为b 的顶点覆盖为C ,对于任意顶点vi ∈C ,设其在G'中相对 应的顶点为wi  和wi'   ,则将边(wi ,wi') 添加到E '。对C中的每个顶点都这样处 理后,所得到的边集E '即是G'的一个大小为b 的最小反馈弧集。因为对于顶 点wi 和wi',当去掉边( wi, wi ')

2017-07-12 00:52:30 276

原创 Leetcode 257 Binary Tree Paths

Q: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: ["1->2->5", "1->3"]

2017-07-12 00:42:45 208

原创 Leetcode 199 Binary Tree Right Side View

Q: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For example: Given the following binary tree,

2017-07-06 11:58:09 189

原创 Leetcode 100 Same Tree

Q: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value.

2017-07-06 00:23:48 227

原创 Leetcode 94 Binary Tree Inorder Traversal

Q: Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree [1,null,2,3], 1 \ 2 / 3 return [1,3,2]. A: /*

2017-07-05 20:50:29 401

原创 Leetcode 207 Course Schedule

Q: There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is express

2017-06-26 00:20:46 202

原创 Leetcode 104 Maximum Depth of Binary Tree

Q: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. A: /**  * Definition for

2017-06-25 23:44:25 170

原创 leetcode 513 Find Bottom Left Tree Value

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

2017-06-23 15:24:14 295

原创 Leetcode 332 Reconstruct Itinerary

class Solution { public:     vector findItinerary(vector> ticket) {             vector itinerary;                  if(ticket.size()==0){         return itinerary; }         map> map;    

2017-06-21 21:50:36 346

原创 Leetcode 169 Majority Element

class Solution { public:     int majorityElement(vector& nums) {     int majEle;     int count = 0;         for(int i = 0; i     if(count == 0) {     majEle = nums[i];     count++;

2017-04-04 12:44:33 406

原创 Leetcode 53 Maximum Subarray

class Solution { public:     int maxSubArray(vector& nums) {     int maxSub1 = nums[0] + nums[1];     int maxSub2 = nums[0];     int both;     int s1, s2;     int add;         for(int i = 0;

2017-03-13 20:36:27 198

原创 Leetcode 495 Teemo Attacking

In LLP world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascending time series towards Ashe and the poisoning tim

2017-02-26 19:06:14 350

空空如也

空空如也

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

TA关注的人

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