数据结构与算法
文章平均质量分 80
小强的呼呼呼
机器学习爱好者
展开
-
稳定排序和不稳定排序
https://www.cnblogs.com/codingmylife/archive/2012/10/21/2732980.html转载 2017-12-04 22:08:44 · 379 阅读 · 0 评论 -
回溯法题目总结
1. 数字键盘组合17. Letter Combinations of a Phone Numberclass Solution { private static final String[] keys = {"", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv&原创 2018-03-16 02:40:49 · 577 阅读 · 0 评论 -
数据结构-数组题总结
1. 二维数组中的查找在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 主要思路:利用二维数组的有序性,定向地搜索。public class Solution { public boolean Find(int target, int [][] array) ...原创 2018-03-12 20:38:33 · 764 阅读 · 0 评论 -
双指针问题总结
双指针题目1. 和为S的连续正数序列思想: 设计前后两个指针以及一个用于保存当前和的变量import java.util.ArrayList;public class Solution { public ArrayList<ArrayList<Integer> > FindContinuousSequence(int sum) { ...原创 2018-03-13 01:12:26 · 1087 阅读 · 0 评论 -
贪心法题目总结
1. 分饼干Leetcode : 455. Assign Cookies (Easy) Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a gree...原创 2018-03-13 19:18:18 · 772 阅读 · 0 评论 -
链表题目总结
链表题目总结1. 从尾到头打印链表思路: 使用递归import java.util.ArrayList;public class Solution { // 定义在外部,以防递归的时候被覆盖 ArrayList<Integer> ret = new ArrayList<>(); public ArrayList<Integ...原创 2018-03-14 00:48:52 · 372 阅读 · 0 评论 -
二叉树题目总结(Java版本)
二叉树总结1. 重建二叉树import java.util.*;public class Solution { public TreeNode reConstructBinaryTree(int [] pre,int [] in) { if(pre.length == 0||in.length == 0){ return nu...原创 2018-03-27 02:30:33 · 389 阅读 · 0 评论