第Ⅰ部分 开篇 序章第Ⅱ部分 创建型模式篇第1章 单例模式(Single
Pattern)第2章 简单工厂模式(SampleFactory)第3章 抽象工厂模式(Abstract Factory) 第4章 建造者模式(Builder
Pattern)第5章 原型模式(Protype Pattern)...
分类:
其他好文 时间:
2014-05-01 11:39:35
阅读次数:
425
Pat1063代码
题目描述:
Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets,
and Nt is the to...
分类:
其他好文 时间:
2014-04-29 13:44:20
阅读次数:
325
源码:
data segment
string1 db 'Please input a number:',0dh,0ah,'$'
string2 db 0dh,0ah,'It is a number!',0dh,0ah,'$'
string3 db 0dh,0ah,'It is not a number!',0dh,0ah,'$'
data ends
code segme...
分类:
编程语言 时间:
2014-04-29 13:33:20
阅读次数:
559
Mrs Little likes digits most of all. Every year she tries to make the best number of the year. She tries to become more and more intelligent and every year studies a new digit. And the number she make...
分类:
其他好文 时间:
2014-04-29 13:13:21
阅读次数:
309
原题链接: http://oj.leetcode.com/problems/reverse-linked-list-ii/
这道题是比较常见的链表反转操作,不过不是反转整个链表,而是从m到n的一部分。分为两个步骤,第一步是找到m结点所在位置,第二步就是进行反转直到n结点。反转的方法就是每读到一个结点,把它插入到m结点前面位置,然后m结点接到读到结点的下一个。总共只需要一次扫描,所以时间是O(n...
分类:
其他好文 时间:
2014-04-28 10:38:42
阅读次数:
240
原题链接: http://oj.leetcode.com/problems/subsets-ii/
这道题跟Subsets一样是经典的NP问题--求子集。比Subsets稍微复杂一些的是这里的集合中可能出现重复元素,因此我们在求子集的时候要避免出现重复的子集。在Subsets中我们每次加进一个元素就会把原来的子集都加上这个元素,然后再加入到结果集中,但是这样重复的元素就会产生重复的子集。为了避免...
分类:
其他好文 时间:
2014-04-28 10:34:42
阅读次数:
373
直接上存储过程、函数
--执行不带参数但带返回值的存储过程
CREATE OR REPLACE PROCEDURE proc_getUserCount(v_totalCount OUT NUMBER) AS
BEGIN
SELECT COUNT(*) INTO v_totalCount FROM vote_user;
END;
--测试不带参数但带返回值的存储过程
DECLARE
v_t...
分类:
其他好文 时间:
2014-04-28 10:25:43
阅读次数:
461
Accept: 25 Submit: 98
Time Limit: 3000 mSec Memory Limit : 32768 KB
Problem Description
部队中总共有N个士兵,每个士兵有各自的能力指数Xi,在一次演练中,指挥部确定了M个需要防守的地点,指挥部将选择M个士兵依次进入指定地点进行防守任务,获得的参考指数即为M个士兵的能力之和。随着时间的推移,指...
分类:
其他好文 时间:
2014-04-27 22:42:18
阅读次数:
330
BP神经网络
function [W,err]=BPTrain(data,label,hiddenlayers,nodes,type)
%Train the bp artial nueral net work
%input data,label,layers,nodes,type
%data:dim*n
%label:1*n
%layers:m:number of hidden layers
%...
分类:
其他好文 时间:
2014-04-27 21:48:00
阅读次数:
460
解题思路:
高数上的三重积分。注意:PI的精度要大些,一开始用的3.1415926通不过,精度太小,后来百度3.1415926535898。还有浮点数的除法记得*1.0。
题目中的oc = ob这条信息特别关键。
代码:
#include
#include
#include
#include
using namespace std;
#define pi 3.1415...
分类:
其他好文 时间:
2014-04-27 21:18:00
阅读次数:
387