- 博客(5)
- 资源 (2)
- 收藏
- 关注
原创 数的深度广度优先遍历
import java.util.Queue; import java.util.concurrent.LinkedBlockingQueue; class TreeNode{ int item; TreeNode left; TreeNode right; } public class test1 { public static void walkDeep...
2018-12-10 15:57:15 80803
原创 寻找第i 小的数
思想借鉴快排, 但是时间复杂度是快排的一半 public class test1 { public static int serarch(int[] array, int low, int high, int findIndex){ int lowHis = low; int highHis = high; if(low >= ...
2018-12-10 14:31:38 81418
原创 BST 二叉搜素树, 排序算法一种
1. 二叉 2. 根大约整个左字数, 小于整个右子数 class Node{ int num; Node left; Node right; } public class BST { public static void bstSort(Node node, int item){ if(node.num < item){ ...
2018-12-07 17:46:11 80625
原创 求解最长公共子序列:动态规划, 子问题分解
求解最长公共子序列:动态规划, 子问题分解 public String LCS(String str1, String str2){ if(str1.length() == 0 || str2.length() == 0) return ""; if(str1.charAt(str1.length() -1) == str2.charAt(str2.le...
2018-12-06 17:48:14 81037
原创 trie 字典树构造
import org.junit.Test; import java.util.ArrayList; public class MyTest { // 单词 class Word{ char lastChar; // 单词最后一个字符 int wordCount = 0; // 词频 } // 字典树 class Tre...
2018-12-04 17:54:57 81393
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人