博客地址:http://blog.csdn.net/muyang_ren
内核链表示意图
关于内核链表与简单的双向连表,是否有过疑惑
内核链表定义:
struct list_head{
struct list_head *next,*prev;
};
struct doublelist{
datatype data;
struct list_head list;...
分类:
其他 时间:
2015-04-11 16:24:14
收藏:
0 评论:
0 赞:
0 阅读:
291
Yii2的增删改查代码,虽然简单,但是对于入门新手还是有必要看一下的...
分类:
其他 时间:
2015-04-11 16:24:04
收藏:
0 评论:
0 赞:
0 阅读:
1773
这里一般的完全背包做法:转化为01背包(可以对01背包进行二进制优化),复杂度是O(n?V?logV/cost[i]2)O(n*V*log^{V/cost[i]}_2)。
这里巧妙的定义了一种方法让复杂度降到了O(n?V)O(n*V)
**转移方程思想:定义能装满dp[i][j]为容量为j时,第i种物品的剩余个数,则:
if (dp[i-1][j] >= 0),dp[i][j]=m...
分类:
其他 时间:
2015-04-11 16:23:24
收藏:
0 评论:
0 赞:
0 阅读:
230
//如果在第一个人拿完以后,第二个人能使得局面是对称的,那么第二个人赢
#include
#include
#include
using namespace std ;
int main()
{
int n , k;
int T ;
scanf("%d",&T) ;
int cas = 0;
while(T--)
{
...
分类:
其他 时间:
2015-04-11 16:23:14
收藏:
0 评论:
0 赞:
0 阅读:
153
题目描述The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, …1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 21 is read off as “one 2,...
分类:
其他 时间:
2015-04-11 16:23:04
收藏:
0 评论:
0 赞:
0 阅读:
191
博客:http://blog.csdn.net/muyang_ren
关于双向链表的原理很多都有说明,我这只是与前面的内核链表作个对比,同样实现数据的增删差改。
截图:
1、main.c
#include "doublelist.h"
int main(void)
{
int num, i;
double_plist list;
doubleli...
分类:
其他 时间:
2015-04-11 16:22:44
收藏:
0 评论:
0 赞:
0 阅读:
273
题目:
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of...
分类:
其他 时间:
2015-04-11 16:22:34
收藏:
0 评论:
0 赞:
0 阅读:
168
本章介绍一下GlusterFS的一个重要的特性,Self-heal,也就是自修复性。...
分类:
其他 时间:
2015-04-11 16:22:24
收藏:
0 评论:
0 赞:
0 阅读:
286
题目描述:
有一个神奇的口袋,总的容积是40,用这个口袋可以变出一些物品,这些物品的总体积必须是40。John现在有n个想要得到的物品,每个物品的体积分别是a1,a2……an。John可以从这些物品中选择一些,如果选出的物体的总体积是40,那么利用这个神奇的口袋,John就可以得到这些物品。现在的问题是,John有多少种不同的选择物品的方式。
输入:
输入的第一行是正整数n (1...
分类:
其他 时间:
2015-04-11 16:22:04
收藏:
0 评论:
0 赞:
0 阅读:
203
#1121 : 二分图一?二分图判定
时间限制:10000ms
单点时限:1000ms
内存限制:256MB
描述
大家好,我是小Hi和小Ho的小伙伴Nettle,从这个星期开始由我来完成我们的Weekly。
新年回家,又到了一年一度大龄剩男剩女的相亲时间。Nettle去姑姑家玩的时候看到了一张姑姑写的相亲情况表,上面都是姑姑介绍相亲的剩男剩女们。每行有2个名字,表示这两个...
分类:
其他 时间:
2015-04-11 16:22:00
收藏:
0 评论:
0 赞:
0 阅读:
195
一、安装Yii
1. 从 yiiframework.com 下载 Yii 框架。
2. 将 Yii 压缩包解压至一个 Web 可访问的目录
二、建立一个 Yii 应用
在命令行运行 yiic,如下所示:
% YiiRoot/framework/yiic webapp WebRoot/ yii_pro
(注:YiiRoot 为 Yii 的安装目录)
该...
分类:
其他 时间:
2015-04-11 16:21:34
收藏:
0 评论:
0 赞:
0 阅读:
155
Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
解题思路:
n!=2^x*3^y*5^z...,注意到一个2和一个5...
分类:
其他 时间:
2015-04-11 16:21:24
收藏:
0 评论:
0 赞:
0 阅读:
114
题目:
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
...
分类:
其他 时间:
2015-04-11 16:20:34
收藏:
0 评论:
0 赞:
0 阅读:
253
题目描述Given an array of size n, find the majority element. The majority element is the element that appears more than ? n/2 ? times.You may assume that the array is non-empty and the majority element alw...
分类:
其他 时间:
2015-04-11 16:20:24
收藏:
0 评论:
0 赞:
0 阅读:
230
太阳与地球
浏览器不支持Canvas元素
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var time = 0;
function draw() {
//清...
分类:
其他 时间:
2015-04-11 16:20:04
收藏:
0 评论:
0 赞:
0 阅读:
221
参考:二维码工具之qrcode 二维码生成与解析代码实现、http://www.swetake.com/qrcode/需要的包:Qrcode_swetake.jar、qrcode.jarTwoDimensionCode类:二维码操作核心类package com.bueryang.util;impor...
分类:
其他 时间:
2015-04-11 16:19:04
收藏:
0 评论:
0 赞:
0 阅读:
186
Linux系统上的/proc目录是一种文件系统,即proc文件系统。与其它常见的文件系统不同的是,/proc是一种伪文件系统(也即虚拟文件系统),存储的是当前内核运行状态的一系列特殊文件,用户可以通过这些文件查看有关系统硬件及当前正在运行进程的信息,甚至可以通过更改其中某些文件来改变内核的运行状态。...
分类:
其他 时间:
2015-04-11 16:18:44
收藏:
0 评论:
0 赞:
0 阅读:
265
function delfile($filename){ if (!file_exists($filename)) { return; } if (!is_dir($filename)) { unlink($filename); retur...
分类:
其他 时间:
2015-04-11 16:18:24
收藏:
0 评论:
0 赞:
0 阅读:
117
旋转卡壳的经典应用,实现时直接比较角度。 1 /************************************************************** 2 Problem: 1185 3 User: idy002 4 Language: C++ ...
分类:
其他 时间:
2015-04-11 16:18:04
收藏:
0 评论:
0 赞:
0 阅读:
225
给定一个n*n的二维向量,顺时针旋转90度 class Solution {public: void rotate(vector > &matrix) { int length = matrix.size(); for (int i = 0; i < length/2; i++) { for (in...
分类:
其他 时间:
2015-04-11 16:17:44
收藏:
0 评论:
0 赞:
0 阅读:
101