摘要:
public class 连续子数组的最大和{ // 时间复杂度为O(n) private static int getSubMaxSum(int[] array) { if (array == null || array.length == 0) { return 0; } int sum = 0 阅读全文
摘要:
public class 字符串全排列{ public static void allSortOfStr(char[] arr, int begin, int end) { if (begin == end) { // 只有一个字符进行全排序时,进行输出 for (int i = 0; i <= e 阅读全文
摘要:
public class 二叉树中和为某为某一值的路径{ // 使用回溯算法 递归实现,分析好终止条件 public void findPath(TreeNode root, int expectedNum) { if (root == null) { return; } if (expectedN 阅读全文