<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[业精于勤，荒于嬉]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/yeqiuzs</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; yeqiuzs]]></copyright><item><title><![CDATA[理解Paxos算法的推导过程]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/76862026</link><guid>https://blog.csdn.net/yeqiuzs/article/details/76862026</guid><author>yeqiuzs</author><pubDate>Mon, 07 Aug 2017 23:26:33 +0800</pubDate><description><![CDATA[Paxos作为分布式系统的基石，一直都是CS领域的热门话题，Paxos号称是最难理解的算法。最近几天一直在看Paxos相关资料，发现Paxos算法执行过程很简单，但如何推导出Paxos算法确实令人费解。网上有大量关于Paxos的基本概念、算法描述、推导过程等文章，所以关于Paxos的基本概念就不赘述了，但大部分文章都没有说明白推导过程中一些容易让人疑惑的问题（例如为什么题案要被设计为编号+value]]></description><category></category></item><item><title><![CDATA[理解分布式一致性协议：二、三阶段提交]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/76853135</link><guid>https://blog.csdn.net/yeqiuzs/article/details/76853135</guid><author>yeqiuzs</author><pubDate>Mon, 07 Aug 2017 17:15:19 +0800</pubDate><description><![CDATA[由于毕设和Lab项目需要，最近在看《从paxos到zookeeper分布式一致性原理与实践》， 2和3PC算法流程，网上资料很多，就不赘述了。由于书中关于2PC和3PC的缺点的部分描述不容易让人理解，因此本文主要想讨论一下2和3PC存在哪些优缺点？为什么存在这些缺点？  以及该协议适应的场景。2PC 二阶段提交2PC其实就是先尝试执行事务再提交的策略，如果有一个参与者出现问题，则回滚尝试期间做的事务]]></description><category></category></item><item><title><![CDATA[如何构造另一个随机生成函数？]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/76618913</link><guid>https://blog.csdn.net/yeqiuzs/article/details/76618913</guid><author>yeqiuzs</author><pubDate>Thu, 03 Aug 2017 14:25:49 +0800</pubDate><description><![CDATA[昨天下午面搜狐的时候被问到了构造随机数生成函数的问题，事后觉得有必要归纳一下相关题型。
  1.已知随机数生成函数randA能等概率生成0~n的整数，设计一个等概率生成0~m的randB
算法： 
若n大于m，则直接利用randA随机产生的数作为randB，如果randA产生的数大于m则丢弃这个数，重新产生，直至成功。若n远大于m，则只需构造最大值为m*(n/m)的随机函数randC，然后丢弃ran]]></description><category></category></item><item><title><![CDATA[【Leet】453. Minimum Moves to Equal Array Elements]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/53078666</link><guid>https://blog.csdn.net/yeqiuzs/article/details/53078666</guid><author>yeqiuzs</author><pubDate>Tue, 08 Nov 2016 08:53:30 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/problems/minimum-moves-to-equal-array-elements/

题目：

Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equa]]></description><category></category></item><item><title><![CDATA[【hihocoder】#1051 : 补提交卡]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52733996</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52733996</guid><author>yeqiuzs</author><pubDate>Tue, 04 Oct 2016 15:16:35 +0800</pubDate><description><![CDATA[题目链接：http://hihocoder.com/problemset/problem/1051题目： 
描述 
小Ho给自己定了一个宏伟的目标：连续100天每天坚持在hihoCoder上提交一个程序。100天过去了，小Ho查看自己的提交记录发现有N天因为贪玩忘记提交了。于是小Ho软磨硬泡、强忍着小Hi鄙视的眼神从小Hi那里要来M张”补提交卡”。每张”补提交卡”都可以补回一天的提交，将原本没有提交]]></description><category></category></item><item><title><![CDATA[【hihocoder】#1094 : Lost in the City]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52733982</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52733982</guid><author>yeqiuzs</author><pubDate>Tue, 04 Oct 2016 15:12:00 +0800</pubDate><description><![CDATA[题目链接：http://hihocoder.com/problemset/problem/1094题目： 
描述 
Little Hi gets lost in the city. He does not know where he is. He does not know which direction is north.Fortunately, Little Hi has a map of th]]></description><category></category></item><item><title><![CDATA[【Leetcode】Convert a Number to Hexadecima]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52727988</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52727988</guid><author>yeqiuzs</author><pubDate>Mon, 03 Oct 2016 14:21:59 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/problems/convert-a-number-to-hexadecimal/

题目：

Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s
 complement method is used]]></description><category></category></item><item><title><![CDATA[【Leetcode】410. Split Array Largest Sum]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52723507</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52723507</guid><author>yeqiuzs</author><pubDate>Sun, 02 Oct 2016 13:19:52 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/contest/7/problems/split-array-largest-sum/]


题目：
Given
 an array which consists of non-negative integers and an integer m, you can split the array into m non-empty con]]></description><category></category></item><item><title><![CDATA[【Leetcode】408. Valid Word Abbreviation]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52723487</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52723487</guid><author>yeqiuzs</author><pubDate>Sun, 02 Oct 2016 13:09:02 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/contest/7/problems/valid-word-abbreviation/题目： 
Given a non-empty string s and an abbreviation abbr, return whether the string matches with the given abbreviation.A string suc]]></description><category></category></item><item><title><![CDATA[【Leetcode】409. Longest Palindrome]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52723472</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52723472</guid><author>yeqiuzs</author><pubDate>Sun, 02 Oct 2016 13:04:32 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/contest/7/problems/longest-palindrome/题目： 
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with t]]></description><category></category></item><item><title><![CDATA[【Leetcode】402. Remove K Digits]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52574177</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52574177</guid><author>yeqiuzs</author><pubDate>Sun, 18 Sep 2016 14:24:53 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/contest/5/problems/remove-k-digits/题目： 
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possib]]></description><category></category></item><item><title><![CDATA[【Leetcode】400. Nth Digit]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52573876</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52573876</guid><author>yeqiuzs</author><pubDate>Sun, 18 Sep 2016 13:58:43 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/contest/5/problems/nth-digit/题目： 
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, … 
Note: 
n is positive and will fit within the range]]></description><category></category></item><item><title><![CDATA[【Leetcode】401. Binary Watch]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52573772</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52573772</guid><author>yeqiuzs</author><pubDate>Sun, 18 Sep 2016 13:48:33 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/contest/5/problems/binary-watch/题目： 
A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).Each LED]]></description><category></category></item><item><title><![CDATA[【Hihocoder】#1049 : 后序遍历]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52562715</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52562715</guid><author>yeqiuzs</author><pubDate>Sat, 17 Sep 2016 12:56:27 +0800</pubDate><description><![CDATA[题目链接：http://hihocoder.com/problemset/problem/1049




题目描述：

没错！小Ho在这一周遇到的问题便是：给出一棵二叉树的前序和中序遍历的结果，还原这棵二叉树并输出其后序遍历的结果。


输入

每个测试点（输入文件）有且仅有一组测试数据。

每组测试数据的第一行为一个由大写英文字母组成的字符串，表示该二叉树的前序遍历]]></description><category></category></item><item><title><![CDATA[【hihocoder】1141 : 二分·归并排序之逆序对]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52557114</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52557114</guid><author>yeqiuzs</author><pubDate>Fri, 16 Sep 2016 19:37:45 +0800</pubDate><description><![CDATA[题目链接：http://hihocoder.com/problemset/problem/1141
题目：

我们可以看到，船默认排序是以等级为参数。但实际上一个船的火力值和等级的关系并不大，所以会存在A船比B船等级高，但是A船火力却低于B船这样的情况。比如上图中77级的飞龙改二火力就小于55级的夕立改二。
现在Nettle将按照等级高低的顺序给出所有船的火力值，请你计算出一共有多少对船满]]></description><category></category></item><item><title><![CDATA[【hihocoder】#1366 : 逆序单词]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52557107</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52557107</guid><author>yeqiuzs</author><pubDate>Fri, 16 Sep 2016 19:21:52 +0800</pubDate><description><![CDATA[题目链接：http://hihocoder.com/problemset/problem/1366


思路：
easy ，不解释


算法：
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
 * http://hihocoder.com/problemset/problem]]></description><category></category></item><item><title><![CDATA[【hihocoder】1014 : Trie树]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52557070</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52557070</guid><author>yeqiuzs</author><pubDate>Fri, 16 Sep 2016 19:19:55 +0800</pubDate><description><![CDATA[题目懒得贴了。。
http://hihocoder.com/problemset/problem/1014



思路：
easy。。trie树。。。。不同点在于。。为了查询前缀效率更高，在该树中添加节点时，在添加过程中的节点都记录一下以该节点为父节点有多少个子节点。。。。。（说的我头都晕了，其实就是add word时，从root到新节点经过的路径上的每个节点记录值都加一）


]]></description><category></category></item><item><title><![CDATA[【hihocoder】#1039 : 字符消除]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52557044</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52557044</guid><author>yeqiuzs</author><pubDate>Fri, 16 Sep 2016 19:06:14 +0800</pubDate><description><![CDATA[题目：
小Hi最近在玩一个字符消除游戏。给定一个只包含大写字母"ABC"的字符串s，消除过程是如下进行的：


1)如果s包含长度超过1的由相同字母组成的子串，那么这些子串会被同时消除，余下的子串拼成新的字符串。例如"ABCCBCCCAA"中"CC","CCC"和"AA"会被同时消除，余下"AB"和"B"拼成新的字符串"ABB"。

2)上述消除会反复一轮一轮进行，直到新的字符串不包含]]></description><category></category></item><item><title><![CDATA[【Leetcode】386. Lexicographical Numbers]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52550082</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52550082</guid><author>yeqiuzs</author><pubDate>Thu, 15 Sep 2016 16:29:48 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/problems/lexicographical-numbers/ 
题目： 
Given an integer n, return 1 - n in lexicographical order.For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].Please optimiz]]></description><category></category></item><item><title><![CDATA[【Leetcode】Shortest Palindrome]]></title><link>https://blog.csdn.net/yeqiuzs/article/details/52526008</link><guid>https://blog.csdn.net/yeqiuzs/article/details/52526008</guid><author>yeqiuzs</author><pubDate>Tue, 13 Sep 2016 15:02:01 +0800</pubDate><description><![CDATA[题目链接：https://leetcode.com/problems/shortest-palindrome/ 
题目： 
Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrom]]></description><category></category></item></channel></rss>