<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[lemon2631的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/lemon2631</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; lemon2631]]></copyright><item><title><![CDATA[数据结构与算法-散列]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78794001</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78794001</guid><author>lemon2631</author><pubDate>Sat, 16 Dec 2017 17:04:57 +0800</pubDate><description><![CDATA[理想情况下的散列表是仅包括一些数据项的具有固定大小的数组，数据项关键字通过散列函数被映射到数组的特定位置并存储。理想情况下的散列函数应该计算简单，并且保证任何两个数据项映射到不同的位置。但是这是不可能的。散列函数
如果输入的关键字是整数，则一般的处理方式是key mod TableSizekey\ mod\ TableSize ，并且通常数组的大小TableSizeTableSize为素数。但是在J]]></description><category></category></item><item><title><![CDATA[数据结构与算法-伸展树]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78770180</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78770180</guid><author>lemon2631</author><pubDate>Wed, 13 Dec 2017 14:27:52 +0800</pubDate><description><![CDATA[介绍伸展树是一种特殊的二叉查找树，其基本思想是当一个节点被访问后，需要经过一系列的AVL树的旋转操作将该节点推到根节点。伸展树不要求像AVL树那样保留树的高度或者平衡信息，但是可以保证开始连续MM次对树的操作最多花费O(logN)O(logN)时间。展开展开（splaying）操作是将访问的节点通过一系列旋转变为根节点的过程。假设节点XX是访问路径上非根节点，XX存在父节点PP和祖父节点GG。伸展树]]></description><category></category></item><item><title><![CDATA[数据结构与算法-二叉树]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78696500</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78696500</guid><author>lemon2631</author><pubDate>Mon, 04 Dec 2017 10:21:41 +0800</pubDate><description><![CDATA[树
树的实现 
实现树的一种方法是在每一个节点除数据外还有一些链，使得该节点的每一个儿子都有一个链指向他，但是该节点儿子的数量是不知道的，可以采用如下的方式：
public class TreeNode{
    Object element;
    TreeNode firstChild;//该节点的第一个儿子
    TreeNode nextSibling;//该节点的兄弟节点
}节点nin]]></description><category></category></item><item><title><![CDATA[LeetCode-116. Populating Next Right Pointers in Each Node【二叉树同层节点构成链表】]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78387638</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78387638</guid><author>lemon2631</author><pubDate>Sun, 29 Oct 2017 20:31:42 +0800</pubDate><description><![CDATA[题目描述Given a binary treestruct TreeLinkNode {
  TreeLinkNode *left;
  TreeLinkNode *right;
  TreeLinkNode *next;
}
Populate each next pointer to point to its next right node. If there is no next right n]]></description><category></category></item><item><title><![CDATA[LeetCode-115. Distinct Subsequences【动归】]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78387483</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78387483</guid><author>lemon2631</author><pubDate>Sun, 29 Oct 2017 20:08:03 +0800</pubDate><description><![CDATA[题目描述Given a string S and a string T, count the number of distinct subsequences of S which equals T. 
A subsequence of a string is a new string which is formed from the original string by deleting some]]></description><category></category></item><item><title><![CDATA[LeetCode-114. Flatten Binary Tree to Linked List]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78313142</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78313142</guid><author>lemon2631</author><pubDate>Sun, 22 Oct 2017 20:51:45 +0800</pubDate><description><![CDATA[题目描述Given a binary tree, flatten it to a linked list in-place.For example, 
Given     1
    / \
   2   5
  / \   \
 3   4   6
The flattened tree should look like: 
   1 
    \ 
     2 
      \]]></description><category></category></item><item><title><![CDATA[ReentraintLock及AbstractQueueSychronizer]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78289552</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78289552</guid><author>lemon2631</author><pubDate>Thu, 19 Oct 2017 21:15:16 +0800</pubDate><description><![CDATA[ReentraintLock  AQS]]></description><category></category></item><item><title><![CDATA[LeetCode-113. Path Sum II]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78253892</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78253892</guid><author>lemon2631</author><pubDate>Mon, 16 Oct 2017 20:36:38 +0800</pubDate><description><![CDATA[题目描述Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.题目及实例解题思路该题目与LeetCode-112有着相同的思路，只不过本题目需要将满足条件的路径上所有节点的值输出。代码/**
 * Definition for a binary tre]]></description><category></category></item><item><title><![CDATA[LeetCode-112. Path Sum]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78253839</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78253839</guid><author>lemon2631</author><pubDate>Mon, 16 Oct 2017 20:31:26 +0800</pubDate><description><![CDATA[题目描述Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.题目及实例地址解题思路给定一个二叉树和一个目标值target，问是否在存在从root节点都叶节点的]]></description><category></category></item><item><title><![CDATA[LeetCode-95. Unique Binary Search Trees II]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78212024</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78212024</guid><author>lemon2631</author><pubDate>Thu, 12 Oct 2017 10:39:46 +0800</pubDate><description><![CDATA[题目描述Given an integer n, generate all structurally unique BST’s (binary search trees) that store values 1…n. 
For example, 
Given n = 3, your program should return all 5 unique BST’s shown below. 
   1]]></description><category></category></item><item><title><![CDATA[LeetCode-110. Balanced Binary Tree]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78187421</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78187421</guid><author>lemon2631</author><pubDate>Mon, 09 Oct 2017 22:16:20 +0800</pubDate><description><![CDATA[题目描述Given a binary tree, determine if it is height-balanced. 
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diff]]></description><category></category></item><item><title><![CDATA[LeetCode-109. Convert Sorted List to Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78187313</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78187313</guid><author>lemon2631</author><pubDate>Mon, 09 Oct 2017 22:02:03 +0800</pubDate><description><![CDATA[题目描述Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.解题思路解题思路完全参考LeetCode-108只不过是将数组存储二叉树的元素变成了链表存储。代码/**
 * Definition for singly-linked lis]]></description><category></category></item><item><title><![CDATA[LeetCode-107. Binary Tree Level Order Traversal II]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78177666</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78177666</guid><author>lemon2631</author><pubDate>Sun, 08 Oct 2017 21:26:09 +0800</pubDate><description><![CDATA[题目描述Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root). 
For example: 
Given binary tree [3,9,20,null,null,]]></description><category></category></item><item><title><![CDATA[LeetCode-108. Convert Sorted Array to Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78177406</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78177406</guid><author>lemon2631</author><pubDate>Sun, 08 Oct 2017 20:53:53 +0800</pubDate><description><![CDATA[题目描述Given an array where elements are sorted in ascending order, convert it to a height balanced BST.解题思路首先想到的是递归的方式，首先取中间位置的元素构成root节点，然后左段元素中取中间位置的元素作为root节点的左节点，取右段元素中间位置的元素作为root节点的右节点，以此类推。 
遍历的方式]]></description><category></category></item><item><title><![CDATA[LeetCode-106. Construct Binary Tree from Inorder and Postorder Traversal]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78176798</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78176798</guid><author>lemon2631</author><pubDate>Sun, 08 Oct 2017 19:42:24 +0800</pubDate><description><![CDATA[题目描述Given inorder and postorder traversal of a tree, construct the binary tree. 
Note: 
You may assume that duplicates do not exist in the tree.解题思路根据二叉树中序遍历（左中右）和后序遍历（左右中）的结果恢复二叉树，和LeetCode-105相同的思路，也]]></description><category></category></item><item><title><![CDATA[LeetCode-105. Construct Binary Tree from Preorder and Inorder Traversal]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78167529</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78167529</guid><author>lemon2631</author><pubDate>Fri, 06 Oct 2017 22:32:59 +0800</pubDate><description><![CDATA[题目描述Given preorder and inorder traversal of a tree, construct the binary tree. 
Note: 
You may assume that duplicates do not exist in the tree.解题思路根据二叉树的先序遍历（中左右）和后续遍历（左中右）恢复原来的二叉树。 
1.  递归的方式求解，将该问题划分]]></description><category></category></item><item><title><![CDATA[LeetCode-104. Maximum Depth of Binary Tree]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78163204</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78163204</guid><author>lemon2631</author><pubDate>Thu, 05 Oct 2017 22:18:01 +0800</pubDate><description><![CDATA[题目描述Given a binary tree, find its maximum depth. 
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.解题思路求解树的最大高度，利用递归可以很容易的求解。代码/**
 * De]]></description><category></category></item><item><title><![CDATA[LeetCode-103. Binary Tree Zigzag Level Order Traversal]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78163181</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78163181</guid><author>lemon2631</author><pubDate>Thu, 05 Oct 2017 22:13:42 +0800</pubDate><description><![CDATA[算法描述Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and alternate between).For example: 
Given binary t]]></description><category></category></item><item><title><![CDATA[LeetCode-102. Binary Tree Level Order Traversal]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78162965</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78162965</guid><author>lemon2631</author><pubDate>Thu, 05 Oct 2017 21:32:13 +0800</pubDate><description><![CDATA[题目描述Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level). 
For example: 
Given binary tree [3,9,20,null,null,15,7], 
    3 
   / \ 
  9]]></description><category></category></item><item><title><![CDATA[LeetCode-101. Symmetric Tree]]></title><link>https://blog.youkuaiyun.com/lemon2631/article/details/78159664</link><guid>https://blog.youkuaiyun.com/lemon2631/article/details/78159664</guid><author>lemon2631</author><pubDate>Wed, 04 Oct 2017 22:08:43 +0800</pubDate><description><![CDATA[问题描述Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). 
For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 
    1 
   / \ 
  2   2 
 / \ / \ 
3  4 4]]></description><category></category></item></channel></rss>