码迷,mamicode.com
首页 > 其他好文
喜羊羊系列之数据结构内核链表
博客地址: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:25:05    阅读次数:221
YII2 CURD 增删改查
Yii2的增删改查代码,虽然简单,但是对于入门新手还是有必要看一下的...
分类:其他好文   时间:2015-04-11 16:26:56    阅读次数:243
挑战程序设计竞赛 多重部分和问题(恰好装满的完全背包)
这里一般的完全背包做法:转化为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:25:23    阅读次数:190
hdu3951Coin Game 博弈
//如果在第一个人拿完以后,第二个人能使得局面是对称的,那么第二个人赢 #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:26:23    阅读次数:131
Leetcode (3) Count and Say
题目描述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:26:20    阅读次数:125
喜羊羊系列之数据结构双向链表
博客: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:26:02    阅读次数:200
Leetcode: Gray Code
题目: 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:25:26    阅读次数:127
【GlusterFS学习之二】:GlusterFS的Self-Heal特性
本章介绍一下GlusterFS的一个重要的特性,Self-heal,也就是自修复性。...
分类:其他好文   时间:2015-04-11 16:23:08    阅读次数:186
题目1114:神奇的口袋
题目描述: 有一个神奇的口袋,总的容积是40,用这个口袋可以变出一些物品,这些物品的总体积必须是40。John现在有n个想要得到的物品,每个物品的体积分别是a1,a2……an。John可以从这些物品中选择一些,如果选出的物体的总体积是40,那么利用这个神奇的口袋,John就可以得到这些物品。现在的问题是,John有多少种不同的选择物品的方式。 输入: 输入的第一行是正整数n (1...
分类:其他好文   时间:2015-04-11 16:25:05    阅读次数:171
#1121 : 二分图一?二分图判定 (HIHOCoder +二分图的判定)
#1121 : 二分图一?二分图判定 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 大家好,我是小Hi和小Ho的小伙伴Nettle,从这个星期开始由我来完成我们的Weekly。 新年回家,又到了一年一度大龄剩男剩女的相亲时间。Nettle去姑姑家玩的时候看到了一张姑姑写的相亲情况表,上面都是姑姑介绍相亲的剩男剩女们。每行有2个名字,表示这两个...
分类:其他好文   时间:2015-04-11 16:25:07    阅读次数:124
YII入门(1)--建立一个YII应用
一、安装Yii 1. 从 yiiframework.com 下载 Yii  框架。 2. 将 Yii  压缩包解压至一个 Web  可访问的目录 二、建立一个 Yii 应用 在命令行运行 yiic,如下所示:     % YiiRoot/framework/yiic webapp WebRoot/ yii_pro     (注:YiiRoot 为 Yii 的安装目录) 该...
分类:其他好文   时间:2015-04-11 16:22:44    阅读次数:112
[LeetCode] Factorial Trailing Zeroe
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:43    阅读次数:141
Palindrome Partitioning--LeetCode
题目: 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:22:37    阅读次数:129
Leetcode (4) Majority Element
题目描述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:22:01    阅读次数:195
Canvas之太阳与地球
太阳与地球 浏览器不支持Canvas元素 var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); var time = 0; function draw() { //清...
分类:其他好文   时间:2015-04-11 16:22:41    阅读次数:118
Qrcode
参考:二维码工具之qrcode 二维码生成与解析代码实现、http://www.swetake.com/qrcode/需要的包:Qrcode_swetake.jar、qrcode.jarTwoDimensionCode类:二维码操作核心类package com.bueryang.util;impor...
分类:其他好文   时间:2015-04-11 16:22:16    阅读次数:116
[转]深入理解/proc目录
Linux系统上的/proc目录是一种文件系统,即proc文件系统。与其它常见的文件系统不同的是,/proc是一种伪文件系统(也即虚拟文件系统),存储的是当前内核运行状态的一系列特殊文件,用户可以通过这些文件查看有关系统硬件及当前正在运行进程的信息,甚至可以通过更改其中某些文件来改变内核的运行状态。...
分类:其他好文   时间:2015-04-11 16:20:54    阅读次数:114
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!