算法
文章平均质量分 66
hansegod
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
求包含所有颜色的最小子串
求包含所有颜色的最小子串原创 2015-11-09 22:37:16 · 570 阅读 · 0 评论 -
堆排序(首元空)
public class HeapSort { public void Adjust(int[] a,int i,int size){ int lchild = 2*i; int rchild = 2*i+1; int max=i; if(i<=size/2){ if(lchilda[max]) max=lchild; if(rchilda[max])原创 2015-11-09 21:52:33 · 354 阅读 · 0 评论 -
求数组中最大和子串类问题
public class maxsub { /* * 基于的性质: 1.对于全负的元素,找到最大值即可 * 2.对于最大子串和大于0的,可证明最大子串中任意前缀串大于0 * * 算法:依次计算累加和,当累加和大于原累加和时记录最大值相关信息,当累加和小于零时,由下一元素重新累加 */ static int getmaxsub(int[] a) throws Exce原创 2015-11-09 21:49:20 · 449 阅读 · 0 评论 -
判断序列是否为合法出栈
import java.util.Stack;public class isStackOrder { public static boolean isOrder(final int[] push,final int[] pop){ if(null==push&&null==pop) return true; else if(null==push||null==pop) r原创 2015-11-12 23:56:23 · 614 阅读 · 0 评论 -
快排
-原创 2015-11-14 18:40:16 · 354 阅读 · 0 评论
分享