随笔分类 -  天天算法

算法学习,讨论
摘要:/** * * @Description: 带权随机 * * @param * * @return * * @throws * * @author R.Z */ private int randomWithWeight(Map<Integer, Integer> resultMap) { List< 阅读全文
posted @ 2018-11-16 15:10 暗夜飞羽睿 阅读(231) 评论(0) 推荐(0)
摘要:今天整理了下堆排序,以一个局外人的身份重新整理了一下堆排序(以前学的忘了)堆排序建立在二叉树的基础上,复习了一下二叉树,堆排序写起来也就没有什么难度。 还是上代码 阅读全文
posted @ 2018-04-06 23:32 暗夜飞羽睿 阅读(142) 评论(0) 推荐(0)
摘要:冒泡和和选择很像,并到一起写。 //冒泡算法 public static void bubbleSort( int [] a){ //外层是比较的次数或者叫比较躺数,N个数比较N-1躺,记住 for(int i=0;i<a.length-1;i++){ //循环比较,边界控制 for(int j=0 阅读全文
posted @ 2018-03-30 15:51 暗夜飞羽睿 阅读(127) 评论(0) 推荐(0)
摘要:快排说的很邪乎,原理懂了,实现自然也就出来了; public void static quickSorted( int[] a ,int low ,int high){ //递归结束条件 if(low>=hih){ return ; } int i=low; int j=high int base= 阅读全文
posted @ 2018-03-29 14:15 暗夜飞羽睿 阅读(1018) 评论(0) 推荐(0)