知行合一

BUILD YOUR WORLD

排序:
默认
按更新时间
按访问量

C++_(矩阵)快速幂

#include <iostream> #include <cstdio>using namespace std; const int MOD = 1000;int POW(long long &num); int times; long long N;int ma...

2016-05-14 20:35:59

阅读数:1317

评论数:0

C++_FatMouse' Trade(贪心)

DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The ...

2016-05-14 20:25:04

阅读数:363

评论数:0

C++_DFS求连通度

DescriptionBenny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are plac...

2016-05-10 22:04:34

阅读数:781

评论数:0

C++_BFS求最短路径

DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WA...

2016-05-09 21:39:37

阅读数:1595

评论数:0

Github中.gitignore的使用

使用.gitignore可以选择不向远程仓库中上传文件,但是今天在使用的过程中一直没用。看了看说明是如果在git init之前文件已经存在了,那么该文件就会加入到git的文件树中,所以.gitignore才不会生效,执行以下命令git rm --cached 要删除的文件 -r其中-r表示删除的内...

2016-04-26 18:56:39

阅读数:399

评论数:0

Leetcode_162_Find Peak Element

A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde...

2016-04-25 22:31:24

阅读数:282

评论数:0

C_银行家算法的实现

#include <stdio.h> #include <stdlib.h> #define PRONUM 5 #define RESNUM 4 #define SAFE 1 #define UNSAFE 0int max[PRONUM][RESNUM]; int avai...

2016-04-22 20:59:03

阅读数:401

评论数:0

Leetcode_226_Invert Binary Tree

Invert a binary tree. 题意:反转一棵二叉树 思路:每次交换即可 坑:暂无 代码:/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode...

2016-04-22 09:47:19

阅读数:280

评论数:0

Linux_进程创建

进程创建1、linux创建进程的方式是先通过调用fork创建一个和调用进程基本一样的子进程,二者之间的区别在于PID和PPID不同。然后子进程调用exec函数装载一个新的进程到地址空间执行。 其他的操作系统产生子进程的方式是spawn:在新的地址空间中创建进程,然后载入可执行文件执行。 2、传...

2016-04-22 09:39:37

阅读数:297

评论数:0

Leetcode_104_Maximum Depth of Binary Tree

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 l...

2016-04-20 18:08:51

阅读数:290

评论数:0

Leetcode_338_Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and ...

2016-04-20 18:06:26

阅读数:332

评论数:0

Leetcode_258_Add Digits

Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: ...

2016-04-17 11:15:17

阅读数:315

评论数:0

Leetcode_326_Power of Three

Given an integer, write a function to determine if it is a power of three.Follow up: Could you do it without using any loop / recursion?题意:判断一个数是否为3...

2016-04-13 22:45:25

阅读数:308

评论数:0

Leetcode_144_Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 ...

2016-04-13 17:39:22

阅读数:278

评论数:0

Leetcode_94_Binary Tree Inorder Traversal

Given a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 ...

2016-04-12 22:37:26

阅读数:288

评论数:0

Leetcode_171_Excel Sheet Column Number

Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example:A -&...

2016-04-12 18:06:11

阅读数:181

评论数:0

Leetcode_168_Excel Sheet Column Number

Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A 2 -> B 3 -> C ... 26 -> Z ...

2016-04-12 17:55:19

阅读数:152

评论数:0

Leetcode_86_Partition List

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the ...

2016-04-11 17:37:18

阅读数:131

评论数:0

Leetcode_105_Construct Binary Tree from Preorder and Inorder Traversal

这个题和上一个题差不多是一样的,只不过后序变成了前序,但是思路还是一样的,这次直接顺着上次的思路写的,一遍A了,算是记住这种算法了。/** * Definition for a binary tree node. * struct TreeNode { * int val; * ...

2016-04-11 15:10:49

阅读数:297

评论数:0

Leetcode_106_Construct Binary Tree from Inorder and Postorder Traversal

Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.根据中序和后序遍历确定...

2016-04-09 09:59:39

阅读数:183

评论数:0

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