程序说明
程序效率不高,时间复杂度为O(n^2),有待进一步的优化,呵呵
程序代码
#include
#include
#include
using namespace std;
//求两个大数的乘积(两数均为正数)
string GetProductOfTwoBigNum( string strNumLeft, string strNumRight )
{
///...
分类:
其他好文 时间:
2015-06-16 09:27:56
阅读次数:
201
那么先讲讲什么是“泛型类协变”你可以这样理解,正常的变换 好比object = String
这样的表达式一样协变主要是向上安全的变换,但是需要根据继承链条一层一层
的向上变化 而不需要进行转换因为是隐式转换,先上一层继承类的代码 不过使
用最容易的理解的,你认为是拆箱与装箱也没什么太大的出入 但是指泛型上的...
今天看到两个面试题,居然都做错了。通过这两个面试题,也加深对三目运算是的自动类型转换的理解。
题目1.以下代码输出结果是()。
public class Test {
public static void main(String[] args) {
int a=5;
System.out.println("value is :"+((a<5)?10.9:9));
}
}
...
分类:
编程语言 时间:
2015-06-16 06:47:34
阅读次数:
198
DataContractSerializer对象1 public class Person2 {3 public int Id { get; set; }4 public string Name { get; set; }5 publi...
话说我们昨晚去看了侏罗纪公园,原来xd就是我最爱的巨幕,来美国这么多年了,怀念和小星星一路成长,一路看电影的经历,avatar是我们在美国一起看的第一部电影。老美看完好片子,还喜欢鼓个掌。这题one pass in place就是麻烦,要多做个string来判断单词要用到sb的insert,不过可以...
分类:
其他好文 时间:
2015-06-16 06:39:10
阅读次数:
123
class Program { static void Main(string[] args) { #region 键值对集合使用,Hashtable //1.创建一个集合对象 Hashtabl...
分类:
其他好文 时间:
2015-06-16 01:12:17
阅读次数:
230
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2015-06-16 01:06:45
阅读次数:
166
比如主串为:”1001110110”
子串为:”11“
则出现位置分别为:3 4 7//KMP算法 2015.6.7#include
#include
using namespace std;int main()
{
char *s = "1001110110";
char *p = "11";
int ar[20] = {...
分类:
编程语言 时间:
2015-06-15 23:59:17
阅读次数:
340
题目:
给定一个字符串, 一个数组,判断这个字符串能否被分隔成字典里的一个个单词。用动态规划算法
我面试时写的是下面的代码 public static boolean divied2(String s,String[] dict){
boolean result=false;
if(s.length()==0)
return true...
分类:
编程语言 时间:
2015-06-15 23:57:51
阅读次数:
195
对rewrite来说,正则匹配不会包括hostname以及query string;
这样实现的规则其实就类似于:
rewrite ^/index/([\d+])/(.*).html$ /index.php?atype=$2&user=$1 last...
分类:
其他好文 时间:
2015-06-15 23:56:20
阅读次数:
164