三步让 企业库支持 mysql 数据库
1.创建 MySqlDatabaseData 类
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel;
using...
分类:
数据库 时间:
2014-06-20 12:49:38
阅读次数:
476
题目
Write a function to find the longest common prefix string amongst an array of strings.
原题链接
解题思想
给一个字符串数组,求这些字符串的最长公共前缀。
这个题应该是比较简单的,直接写代码,一次AC。解题思想是依次对数组中的字符串求最长公共前缀。
代码实现
class Sol...
分类:
其他好文 时间:
2014-06-20 12:25:09
阅读次数:
247
昨天做了leetcode里的 Longest Palindromic Substring ,一开始用动态规划O(N^2),不管怎么改都超时了。。。于是在大神的帮助下,找到了传说中的Manacher算法,居然能在O(n)内求出来,瞬间给跪了。
本屌认为,这个算法主要是充分的利用了以前的匹配的结果,来起到了降低时间复杂度的作用,这点跟KMP算是有点类似。在预处理时有个小技巧就是将第0,1为设...
分类:
其他好文 时间:
2014-06-20 12:15:22
阅读次数:
305
本文参考《Android系统源代码情景分析》,作者罗升阳
一、测试代码:
~/Android/external/binder/server
----FregServer.cpp
~/Android/external/binder/common
----IFregService.cpp...
分类:
其他好文 时间:
2014-06-20 10:15:53
阅读次数:
370
1.请首先确保你的eclipse是javaee版本的,或者已经安装wtp插件2.然后修改eclipse工程下的.project文件:3.在中加入
org.eclipse.wst.common.project.facet.core.nature org.eclipse.wst.common.modul...
分类:
系统相关 时间:
2014-06-11 22:15:54
阅读次数:
387
第一种方法,用栈实现,最容易想到,也比较容易实现,每次碰到‘)’时update
max_len,由于要保存之前的‘(’的index,所以spacecomplexity 是O(n) 1 // 使用栈,时间复杂度 O(n),空间复杂度 O(n)
2 class Solution { 3 publ...
分类:
其他好文 时间:
2014-06-11 09:16:10
阅读次数:
197
最长回文字串,相信做过Palindrome Partitioning II 这个题的同学应该可以很快做出来。没错,这个题还可以使用动态规划方法得到一个时间复杂度为O(n^2)的解法,当然如果你想要更好的时间复杂度的算法也是有的。好的,我们先来看看时间复杂度为O(n^2)的算法。
代码实现--动态规划O(n^2)
相信如果你在网上看过了别人的算法,你会发现我的算法是最简洁的。哈哈,这个题需要注意的是如果你用惯了vector的话,你这里肯定会得到超时的提示...
...代码二--复杂度为O(n)的算法...
分类:
其他好文 时间:
2014-06-07 12:08:43
阅读次数:
224
Samba详解原文
http://blog.csdn.net/seward_wang/article/details/12614263 samba-client.i386
samba-common.i386 samba.i386 samba-swat.i386...
分类:
其他好文 时间:
2014-06-05 17:23:51
阅读次数:
207
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 le...
分类:
其他好文 时间:
2014-06-05 14:10:38
阅读次数:
304
我们通过Ninject(http://www.ninject.org/)项目来帮助我们实现MVC.Net与WebAPI项目的IOC实现。首先我们来看MVC.Net的IOC实现。1.
通过NuGet我们安装Ninject.MVC3,它会同时安装Ninject、Ninject.Web.Common和Ni...