摘要: 假如定义形如"{}[]()"或者"{[()]}"的模式为valid,"[{]"或者"(("的模式为invalid,那么我们可以使用一个stack或者递归下降的方法实现.这里我先用stack实现一次.实现的思路是.当遇到开始符号时('[','{'或者'('),我们就将其push进栈。当遇到结束符号的时... 阅读全文
posted @ 2015-11-07 22:01 hudiwei-hdw 阅读(226) 评论(0) 推荐(1) 编辑
摘要: 基于分治法的快排,用递归实现。首先讲一下实现的过程.1.在数组中取一个数作为基准,所谓的基准就是用来对比的数.2.然后在数组中从后往前找,找到一个逆序数为止,找到之后就把它的值赋值到基准数的位,假设此逆序数的为止为j.3.然后再数组中从前往后找,找到一个逆序为止,然后把这个值赋值到j位置,假设此次逆... 阅读全文
posted @ 2015-11-07 21:46 hudiwei-hdw 阅读(212) 评论(0) 推荐(1) 编辑
摘要: public class Solution { public int length = 0; public Object[] numToArrays(int num) { List list = new ArrayList(); while (num / 10... 阅读全文
posted @ 2015-11-04 10:16 hudiwei-hdw 阅读(241) 评论(0) 推荐(2) 编辑
摘要: #include #include int length=0;struct ListNode { int val; struct ListNode *next;};void make(struct ListNode* &list){ struct ListNode *tail=... 阅读全文
posted @ 2015-10-30 11:08 hudiwei-hdw 阅读(184) 评论(0) 推荐(2) 编辑
摘要: 一般bfs算法都是使用递归 //下面简单的代码 visited[Max]; dfs(_graph g,int vo){ print(vo); visited[vo]=1 for(int i=0;i<Max;i++){ if(visited[i]==0){ dfs(g,i); } } } 阅读全文
posted @ 2015-10-22 14:43 hudiwei-hdw 阅读(211) 评论(0) 推荐(2) 编辑
摘要: 高斯模糊是众多模糊算法中的一种,所谓的模糊,就是平滑图像,消除像素之间的差异,最容易想到的方法就是均值平滑。1.均值模糊均值模糊就是取目标像素周围像素的平均值.譬如像素矩阵.|1|1|1||1|2|1||1|1|1|,经过均值模糊后,就变成|1|1|1||1|1|1||1|1|1|,这样就模糊了像素... 阅读全文
posted @ 2015-10-01 14:58 hudiwei-hdw 阅读(402) 评论(0) 推荐(2) 编辑
摘要: #include int MAX(int x,int y){ return x>y?x:y;}int rob(int* nums, int numsSize) { int *m; int i; m = (int *)malloc(sizeof(int)*(numsSize+1)); m[0]... 阅读全文
posted @ 2015-07-29 09:04 hudiwei-hdw 阅读(161) 评论(0) 推荐(2) 编辑
摘要: Rectangle AreadC Code#include int computeArea(int A,int B,int C,int D,int E,int F,int G,int H){ float ALX = (C-A) ; float ALY = (D-B) ; float BLX = (G... 阅读全文
posted @ 2015-07-09 10:03 hudiwei-hdw 阅读(205) 评论(0) 推荐(2) 编辑
摘要: 4ms C AC CODE..int hammingWeight(uint32_t n) { int i; unsigned int t; int c = 0; for(i=0;i= (1<<31)) c++; return c;} 阅读全文
posted @ 2015-07-02 14:16 hudiwei-hdw 阅读(120) 评论(0) 推荐(2) 编辑
摘要: Hibernate3.jar 这个是hibernate最主要的jar包ant-1.63.jar Ant 的核心包,在构建Hibernate 时会用到antlr-2.7.5H3.jar 语言转换工,Hibernate利用它实现 HQL 到 SQL的转换asm.jar/asm-attrs.jar ASM... 阅读全文
posted @ 2015-03-06 12:02 hudiwei-hdw 阅读(157) 评论(0) 推荐(1) 编辑