<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[liveway6的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/liveway6</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; liveway6]]></copyright><item><title><![CDATA[托福作文模板-A或B类型]]></title><link>https://blog.csdn.net/liveway6/article/details/119878337</link><guid>https://blog.csdn.net/liveway6/article/details/119878337</guid><author>liveway6</author><pubDate>Mon, 23 Aug 2021 22:50:38 +0800</pubDate><description><![CDATA[A或B类型
模板1
Depending on personal experience, personality type and emotional concern, we find that some people hold the idea of A meanwhile others prefer to B, from my point of view, it is more advisable to choose A rather than B. My arguments for this point]]></description><category></category></item><item><title><![CDATA[Linux实用命令集]]></title><link>https://blog.csdn.net/liveway6/article/details/103566510</link><guid>https://blog.csdn.net/liveway6/article/details/103566510</guid><author>liveway6</author><pubDate>Mon, 16 Dec 2019 17:25:18 +0800</pubDate><description><![CDATA[pip install
问题
wsj@noah008:~/app/Tree-0.2.4$ pip install tree
Traceback (most recent call last):
  File "/home/anaconda3/bin/pip", line 11, in &lt;module&gt;
    sys.exit(main())
TypeError: 'module' o...]]></description><category></category></item><item><title><![CDATA[剑指offer：剪绳子]]></title><link>https://blog.csdn.net/liveway6/article/details/102423425</link><guid>https://blog.csdn.net/liveway6/article/details/102423425</guid><author>liveway6</author><pubDate>Wed, 09 Oct 2019 00:35:51 +0800</pubDate><description><![CDATA[题目描述
给你一根长度为n的绳子，请把绳子剪成m段（m、n都是整数，n&gt;1并且m&gt;1），每段绳子的长度记为k[0],k[1],…,k[m]。请问k[0]xk[1]x…xk[m]可能的最大乘积是多少？例如，当绳子的长度是8时，我们把它剪成长度分别为2、3、3的三段，此时得到的最大乘积是18。
解题思路

找规律

链接：https://www.nowcoder.com/questionT...]]></description><category></category></item><item><title><![CDATA[剑指offer：机器人的运动范围]]></title><link>https://blog.csdn.net/liveway6/article/details/102422476</link><guid>https://blog.csdn.net/liveway6/article/details/102422476</guid><author>liveway6</author><pubDate>Wed, 09 Oct 2019 00:09:25 +0800</pubDate><description><![CDATA[题目描述
地上有一个m行和n列的方格。一个机器人从坐标0,0的格子开始移动，每一次只能向左，右，上，下四个方向移动一格，但是不能进入行坐标和列坐标的数位之和大于k的格子。 例如，当k为18时，机器人能够进入方格（35,37），因为3+5+3+7 = 18。但是，它不能进入方格（35,38），因为3+5+3+8 = 19。请问该机器人能够达到多少个格子？
解题思路
class Solution {
...]]></description><category></category></item><item><title><![CDATA[剑指offer:矩阵中的路径]]></title><link>https://blog.csdn.net/liveway6/article/details/102420066</link><guid>https://blog.csdn.net/liveway6/article/details/102420066</guid><author>liveway6</author><pubDate>Wed, 09 Oct 2019 00:08:08 +0800</pubDate><description><![CDATA[题目
请设计一个函数，用来判断在一个矩阵中是否存在一条包含某字符串所有字符的路径。路径可以从矩阵中的任意一个格子开始，每一步可以在矩阵中向左，向右，向上，向下移动一个格子。如果一条路径经过了矩阵中的某一个格子，则该路径不能再进入该格子。 例如 a b c e s f c s a d e e 矩阵中包含一条字符串"bcced"的路径，但是矩阵中不包含"abcb"路径，因为字符串的第一个字符b占据了矩...]]></description><category></category></item><item><title><![CDATA[剑指offer：对称的二叉树]]></title><link>https://blog.csdn.net/liveway6/article/details/101152609</link><guid>https://blog.csdn.net/liveway6/article/details/101152609</guid><author>liveway6</author><pubDate>Sun, 22 Sep 2019 12:34:12 +0800</pubDate><description><![CDATA[题目描述
请实现一个函数，用来判断一颗二叉树是不是对称的。注意，如果一个二叉树同此二叉树的镜像是同样的，定义其为对称的。
解题
递归做法
/*
struct TreeNode {
    int val;
    struct TreeNode *left;
    struct TreeNode *right;
    TreeNode(int x) :
            val(x), ...]]></description><category></category></item><item><title><![CDATA[剑指offer：二叉树的下一个节点]]></title><link>https://blog.csdn.net/liveway6/article/details/101152216</link><guid>https://blog.csdn.net/liveway6/article/details/101152216</guid><author>liveway6</author><pubDate>Sun, 22 Sep 2019 12:15:00 +0800</pubDate><description><![CDATA[题目描述
给定一个二叉树和其中的一个结点，请找出中序遍历顺序的下一个结点并且返回。注意，树中的结点不仅包含左右子结点，同时包含指向父结点的指针。
/*
struct TreeLinkNode {
    int val;
    struct TreeLinkNode *left;
    struct TreeLinkNode *right;
    struct TreeLinkNode *n...]]></description><category></category></item><item><title><![CDATA[剑指offer：删除链表中重复的结点]]></title><link>https://blog.csdn.net/liveway6/article/details/101150651</link><guid>https://blog.csdn.net/liveway6/article/details/101150651</guid><author>liveway6</author><pubDate>Sun, 22 Sep 2019 11:33:15 +0800</pubDate><description><![CDATA[题目描述
在一个排序的链表中，存在重复的结点，请删除该链表中重复的结点，重复的结点不保留，返回链表头指针。 例如，链表1-&gt;2-&gt;3-&gt;3-&gt;4-&gt;4-&gt;5 处理后为 1-&gt;2-&gt;5
解题
非递归做法
/*
struct ListNode {
    int val;
    struct ListNode *next;
    ListNode(i...]]></description><category></category></item><item><title><![CDATA[剑指offer：链表中环的入口结点]]></title><link>https://blog.csdn.net/liveway6/article/details/101025443</link><guid>https://blog.csdn.net/liveway6/article/details/101025443</guid><author>liveway6</author><pubDate>Thu, 19 Sep 2019 15:53:24 +0800</pubDate><description><![CDATA[题目描述
给一个链表，若其中包含环，请找出该链表的环的入口结点，否则，输出null。
解题

快慢指针，fast走两步，slow走一步，当他们相遇时，fast走了一圈环，设环为n个节点，此时slow走的节点为x，则fast走x+n=2x，则有x=n。此时再令一个节点等于pHead和slow一起一次走一步，当他们相遇时，他们的节点为环的入口。

/*
struct ListNode {
    in...]]></description><category></category></item><item><title><![CDATA[剑指offer：字符流中第一个不重复的字符]]></title><link>https://blog.csdn.net/liveway6/article/details/100923012</link><guid>https://blog.csdn.net/liveway6/article/details/100923012</guid><author>liveway6</author><pubDate>Tue, 17 Sep 2019 13:09:31 +0800</pubDate><description><![CDATA[题目描述
请实现一个函数用来找出字符流中第一个只出现一次的字符。例如，当从字符流中只读出前两个字符"go"时，第一个只出现一次的字符是"g"。当从该字符流中读出前六个字符“google"时，第一个只出现一次的字符是"l"。
解题思路
class Solution
{
public:
    string s;
    char hash[256]={0};
  //Insert one char ...]]></description><category></category></item><item><title><![CDATA[剑指offer：表示数值的字符串]]></title><link>https://blog.csdn.net/liveway6/article/details/100920931</link><guid>https://blog.csdn.net/liveway6/article/details/100920931</guid><author>liveway6</author><pubDate>Tue, 17 Sep 2019 11:36:22 +0800</pubDate><description><![CDATA[题目描述
请实现一个函数用来判断字符串是否表示数值（包括整数和小数）。例如，字符串"+100",“5e2”,"-123",“3.1416"和”-1E-16"都表示数值。 但是"12e",“1a3.14”,“1.2.3”,"±5"和"12e+4.3"都不是。
解题
class Solution {
public:
    bool isNumeric(char* string)
    {
    ...]]></description><category></category></item><item><title><![CDATA[剑指offer：正则表达式匹配]]></title><link>https://blog.csdn.net/liveway6/article/details/100920417</link><guid>https://blog.csdn.net/liveway6/article/details/100920417</guid><author>liveway6</author><pubDate>Tue, 17 Sep 2019 11:20:45 +0800</pubDate><description><![CDATA[题目描述
请实现一个函数用来匹配包括’.‘和’‘的正则表达式。模式中的字符’.‘表示任意一个字符，而’'表示它前面的字符可以出现任意次（包含0次）。 在本题中，匹配是指字符串的所有字符匹配整个模式。例如，字符串"aaa"与模式"a.a"和"abaca"匹配，但是与"aa.a"和"ab*a"均不匹配
解题思路
class Solution {
public:
    bool match(char*...]]></description><category></category></item><item><title><![CDATA[快手笔试题]]></title><link>https://blog.csdn.net/liveway6/article/details/100919104</link><guid>https://blog.csdn.net/liveway6/article/details/100919104</guid><author>liveway6</author><pubDate>Tue, 17 Sep 2019 10:56:57 +0800</pubDate><description><![CDATA[矩阵逆时针打印


#include &lt;iostream&gt;
#include &lt;cstdio&gt;
#include &lt;vector&gt;
#include &lt;map&gt;
#include &lt;string&gt;
using namespace std;

void ReverseWord(string &amp;str, int l, int r){
...]]></description><category></category></item><item><title><![CDATA[剑指offer：构建乘积数组]]></title><link>https://blog.csdn.net/liveway6/article/details/100868651</link><guid>https://blog.csdn.net/liveway6/article/details/100868651</guid><author>liveway6</author><pubDate>Mon, 16 Sep 2019 00:16:22 +0800</pubDate><description><![CDATA[题目描述
给定一个数组A[0,1,…,n-1],请构建一个数组B[0,1,…,n-1],其中B中的元素B[i]=A[0]A[1]…*A[i-1]A[i+1]…*A[n-1]。不能使用除法。
解题
暴力求解
class Solution {
public:
    vector&lt;int&gt; multiply(const vector&lt;int&gt;&amp; A) {
       ...]]></description><category></category></item><item><title><![CDATA[剑指offer:数组中重复的数字]]></title><link>https://blog.csdn.net/liveway6/article/details/100868289</link><guid>https://blog.csdn.net/liveway6/article/details/100868289</guid><author>liveway6</author><pubDate>Sun, 15 Sep 2019 23:44:22 +0800</pubDate><description><![CDATA[题目描述
在一个长度为n的数组里的所有数字都在0到n-1的范围内。 数组中某些数字是重复的，但不知道有几个数字是重复的。也不知道每个数字重复几次。请找出数组中任意一个重复的数字。 例如，如果输入长度为7的数组{2,3,1,0,2,5,3}，那么对应的输出是第一个重复的数字2。
解题
hash表求解
class Solution {
public:
    // Parameters:
    //...]]></description><category></category></item><item><title><![CDATA[剑指offer：把字符串转换成整数]]></title><link>https://blog.csdn.net/liveway6/article/details/100867989</link><guid>https://blog.csdn.net/liveway6/article/details/100867989</guid><author>liveway6</author><pubDate>Sun, 15 Sep 2019 23:35:09 +0800</pubDate><description><![CDATA[题目描述
将一个字符串转换成一个整数(实现Integer.valueOf(string)的功能，但是string不符合数字要求时返回0)，要求不能使用字符串转换整数的库函数。 数值为0或者字符串不是一个合法的数值则返回0。
解题
初始版
class Solution {
public:
    int StrToInt(string str) {
        if(str.length()==...]]></description><category></category></item><item><title><![CDATA[剑指offer：不用加减乘除做加法]]></title><link>https://blog.csdn.net/liveway6/article/details/100866988</link><guid>https://blog.csdn.net/liveway6/article/details/100866988</guid><author>liveway6</author><pubDate>Sun, 15 Sep 2019 22:46:18 +0800</pubDate><description><![CDATA[题目描述
写一个函数，求两个整数之和，要求在函数体内不得使用+、-、*、/四则运算符号。
解题思路
class Solution {
public:
    int Add(int num1, int num2)
    {
        int sum, carry;
        do{
            sum=num1^num2;//异或相加，不考虑进位
            ...]]></description><category></category></item><item><title><![CDATA[剑指offer：求1+2+3+...+n]]></title><link>https://blog.csdn.net/liveway6/article/details/100850455</link><guid>https://blog.csdn.net/liveway6/article/details/100850455</guid><author>liveway6</author><pubDate>Sun, 15 Sep 2019 22:30:30 +0800</pubDate><description><![CDATA[题目描述
求1+2+3+…+n，要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句（A?B:C）。
解题思路
短路计算调用递归。
class Solution {
public:
    int Sum_Solution(int n) {
        int ans=n;
        // &amp;&amp;在c++中如果前面为假则后面的...]]></description><category></category></item><item><title><![CDATA[剑指offer：孩子们的游戏(圆圈中最后剩下的数)]]></title><link>https://blog.csdn.net/liveway6/article/details/100825772</link><guid>https://blog.csdn.net/liveway6/article/details/100825772</guid><author>liveway6</author><pubDate>Sat, 14 Sep 2019 12:44:05 +0800</pubDate><description><![CDATA[题目描述
每年六一儿童节,牛客都会准备一些小礼物去看望孤儿院的小朋友,今年亦是如此。HF作为牛客的资深元老,自然也准备了一些小游戏。其中,有个游戏是这样的:首先,让小朋友们围成一个大圈。然后,他随机指定一个数m,让编号为0的小朋友开始报数。每次喊到m-1的那个小朋友要出列唱首歌,然后可以在礼品箱中任意的挑选礼物,并且不再回到圈中,从他的下一个小朋友开始,继续0…m-1报数…这样下去…直到剩下最后一...]]></description><category></category></item><item><title><![CDATA[剑指offer：扑克牌顺子]]></title><link>https://blog.csdn.net/liveway6/article/details/100824702</link><guid>https://blog.csdn.net/liveway6/article/details/100824702</guid><author>liveway6</author><pubDate>Sat, 14 Sep 2019 11:34:44 +0800</pubDate><description><![CDATA[题目描述
LL今天心情特别好,因为他去买了一副扑克牌,发现里面居然有2个大王,2个小王(一副牌原本是54张_)…他随机从中抽出了5张牌,想测测自己的手气,看看能不能抽到顺子,如果抽到的话,他决定去买体育彩票,嘿嘿！！“红心A,黑桃3,小王,大王,方片5”,“Oh My God!”不是顺子…LL不高兴了,他想了想,决定大\小 王可以看成任何数字,并且A看作1,J为11,Q为12,K为13。上面的5张...]]></description><category></category></item></channel></rss>