=w.SCRIPT.id?r.text():w.DISPLAY:"text"===t&&r.size===w.DISPLAY.size?r=w.TEXT:"script"===t?r=w.SCRIPT:"scriptscript"===t&&(r=w.SCRIPTSCRIPT),r},Or=function(t,e){var r,a=Nr(t.size,e.style),n=a.fracNum(),i=a.fracDen();r=e.havingStyle(n);var o=ue(t.numer,r,e);if(t.continued){var s=8.5/e.fontMetrics().ptPerEm,h=3.5/e.fontMetrics().ptPerEm;o.height=o.height0?3*c:7*c,d=e.fontMetrics().denom1):(m>0?(u=e.fontMetrics().num2,p=c):(u=e.fontMetrics().num3,p=3*c),d=e.fontMetrics().denom2),l){var y=e.fontMetrics().axisHeight;u-o.depth-(y+.5*m)0&&(e="."===(e=t)?null:e),e};Qt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(t,e){var r=t.parser,a=e[4],n=e[5],i=Vt(e[0],"atom");i&&(i=Ut(e[0],"open"));var o=i?Er(i.text):null,s=Vt(e[1],"atom");s&&(s=Ut(e[1],"close"));var h,l=s?Er(s.text):null,m=Ft(e[2],"size"),c=null;h=!!m.isBlank||(c=m.value).number>0;var u="auto",p=Vt(e[3],"ordgroup");if(p){if(p.body.length>0){var d=Ft(p.body[0],"textord");u=Rr[Number(d.text)]}}else p=Ft(e[3],"textord"),u=Rr[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:a,denom:n,continued:!1,hasBarLine:h,barSize:c,leftDelim:o,rightDelim:l,size:u}},htmlBuilder:Or,mathmlBuilder:Ir}),Qt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(t,e){var r=t.parser,a=(t.funcName,t.token);return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Ft(e[0],"size").value,token:a}}}),Qt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(t,e){var r=t.parser,a=(t.funcName,e[0]),n=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t}(Ft(e[1],"infix").size),i=e[2],o=n.number>0;return{type:"genfrac",mode:r.mode,numer:a,denom:i,continued:!1,hasBarLine:o,barSize:n,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Or,mathmlBuilder:Ir});var Lr=function(t,e){var r,a,n=e.style,i=Vt(t,"supsub");i?(r=i.sup?ue(i.sup,e.havingStyle(n.sup()),e):ue(i.sub,e.havingStyle(n.sub()),e),a=Ft(i.base,"horizBrace")):a=Ft(t,"horizBrace");var o,s=ue(a.base,e.havingBaseStyle(w.DISPLAY)),h=Ie(a,e);if(a.isOver?(o=Dt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:h}]},e)).children[0].children[0].children[1].classes.push("svg-align"):(o=Dt.makeVList({positionType:"bottom",positionData:s.depth+.1+h.height,children:[{type:"elem",elem:h},{type:"kern",size:.1},{type:"elem",elem:s}]},e)).children[0].children[0].children[0].classes.push("svg-align"),r){var l=Dt.makeSpan(["mord",a.isOver?"mover":"munder"],[o],e);o=a.isOver?Dt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},e):Dt.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return Dt.makeSpan(["mord",a.isOver?"mover":"munder"],[o],e)};Qt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(t,e){var r=t.parser,a=t.funcName;return{type:"horizBrace",mode:r.mode,label:a,isOver:/^\\over/.test(a),base:e[0]}},htmlBuilder:Lr,mathmlBuilder:function(t,e){var r=Oe(t.label);return new ve.MathNode(t.isOver?"mover":"munder",[Me(t.base,e),r])}}),Qt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(t,e){var r=t.parser,a=e[1],n=Ft(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:n})?{type:"href",mode:r.mode,href:n,body:ee(a)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:function(t,e){var r=se(t.body,e,!1);return Dt.makeAnchor(t.href,[],r,e)},mathmlBuilder:function(t,e){var r=Se(t.body,e);return r instanceof ge||(r=new ge("mrow",[r])),r.setAttribute("href",t.href),r}}),Qt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(t,e){var r=t.parser,a=Ft(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:a}))return r.formatUnsupportedCmd("\\url");for(var n=[],i=0;i0&&(a=Tt(t.totalheight,e)-r,a=Number(a.toFixed(2)));var n=0;t.width.number>0&&(n=Tt(t.width,e));var i={height:r+a+"em"};n>0&&(i.width=n+"em"),a>0&&(i.verticalAlign=-a+"em");var o=new I(t.src,t.alt,i);return o.height=r,o.depth=a,o},mathmlBuilder:function(t,e){var r=new ve.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var a=Tt(t.height,e),n=0;if(t.totalheight.number>0&&(n=(n=Tt(t.totalheight,e)-a).toFixed(2),r.setAttribute("valign","-"+n+"em")),r.setAttribute("height",a+n+"em"),t.width.number>0){var i=Tt(t.width,e);r.setAttribute("width",i+"em")}return r.setAttribute("src",t.src),r}}),Qt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(t,e){var r=t.parser,a=t.funcName,n=Ft(e[0],"size");if(r.settings.strict){var i="m"===a[1],o="mu"===n.value.unit;i?(o||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, not "+n.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):o&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:n.value}},htmlBuilder:function(t,e){return Dt.makeGlue(t.dimension,e)},mathmlBuilder:function(t,e){var r=Tt(t.dimension,e);return new ve.SpaceNode(r)}}),Qt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(t,e){var r=t.parser,a=t.funcName,n=e[0];return{type:"lap",mode:r.mode,alignment:a.slice(5),body:n}},htmlBuilder:function(t,e){var r;"clap"===t.alignment?(r=Dt.makeSpan([],[ue(t.body,e)]),r=Dt.makeSpan(["inner"],[r],e)):r=Dt.makeSpan(["inner"],[ue(t.body,e)]);var a=Dt.makeSpan(["fix"],[]),n=Dt.makeSpan([t.alignment],[r,a],e),i=Dt.makeSpan(["strut"]);return i.style.height=n.height+n.depth+"em",i.style.verticalAlign=-n.depth+"em",n.children.unshift(i),n=Dt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e),Dt.makeSpan(["mord"],[n],e)},mathmlBuilder:function(t,e){var r=new ve.MathNode("mpadded",[Me(t.body,e)]);if("rlap"!==t.alignment){var a="llap"===t.alignment?"-1":"-0.5";r.setAttribute("lspace",a+"width")}return r.setAttribute("width","0px"),r}}),Qt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(t,e){var r=t.funcName,a=t.parser,n=a.mode;a.switchMode("math");var i="\\("===r?"\\)":"$",o=a.parseExpression(!1,i);return a.expect(i),a.switchMode(n),{type:"styling",mode:a.mode,style:"text",body:o}}}),Qt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(t,e){throw new o("Mismatched "+t.funcName)}});var Hr=function(t,e){switch(e.style.size){case w.DISPLAY.size:return t.display;case w.TEXT.size:return t.text;case w.SCRIPT.size:return t.script;case w.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Qt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(t,e){return{type:"mathchoice",mode:t.parser.mode,display:ee(e[0]),text:ee(e[1]),script:ee(e[2]),scriptscript:ee(e[3])}},htmlBuilder:function(t,e){var r=Hr(t,e),a=se(r,e,!1);return Dt.makeFragment(a)},mathmlBuilder:function(t,e){var r=Hr(t,e);return Se(r,e)}});var Dr=function(t,e,r,a,n,i,o){var s,h,l;if(t=Dt.makeSpan([],[t]),e){var m=ue(e,a.havingStyle(n.sup()),a);h={elem:m,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-m.depth)}}if(r){var c=ue(r,a.havingStyle(n.sub()),a);s={elem:c,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-c.height)}}if(h&&s){var u=a.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+t.depth+o;l=Dt.makeVList({positionType:"bottom",positionData:u,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:-i+"em"},{type:"kern",size:s.kern},{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:i+"em"},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else if(s){var p=t.height-o;l=Dt.makeVList({positionType:"top",positionData:p,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:-i+"em"},{type:"kern",size:s.kern},{type:"elem",elem:t}]},a)}else{if(!h)return t;var d=t.depth+o;l=Dt.makeVList({positionType:"bottom",positionData:d,children:[{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:i+"em"},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}return Dt.makeSpan(["mop","op-limits"],[l],a)},Fr=["\\smallint"],Vr=function(t,e){var r,a,n,i=!1,o=Vt(t,"supsub");o?(r=o.sup,a=o.sub,n=Ft(o.base,"op"),i=!0):n=Ft(t,"op");var s,h=e.style,l=!1;if(h.size===w.DISPLAY.size&&n.symbol&&!c.contains(Fr,n.name)&&(l=!0),n.symbol){var m=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==n.name&&"\\oiiint"!==n.name||(u=n.name.substr(1),n.name="oiint"===u?"\\iint":"\\iiint"),s=Dt.makeSymbol(n.name,m,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var p=s.italic,d=Dt.staticSvg(u+"Size"+(l?"2":"1"),e);s=Dt.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},e),n.name="\\"+u,s.classes.unshift("mop"),s.italic=p}}else if(n.body){var f=se(n.body,e,!0);1===f.length&&f[0]instanceof E?(s=f[0]).classes[0]="mop":s=Dt.makeSpan(["mop"],Dt.tryCombineChars(f),e)}else{for(var g=[],x=1;x0){for(var h=n.body.map((function(t){var e=t.text;return"string"==typeof e?{type:"textord",mode:t.mode,text:e}:t})),l=se(h,e.withFont("mathrm"),!0),m=0;m=0?s.setAttribute("height","+"+n+"em"):(s.setAttribute("height",n+"em"),s.setAttribute("depth","+"+-n+"em")),s.setAttribute("voffset",n+"em"),s}});var Xr=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Qt({type:"sizing",names:Xr,props:{numArgs:0,allowedInText:!0},handler:function(t,e){var r=t.breakOnTokenText,a=t.funcName,n=t.parser,i=n.parseExpression(!1,r);return{type:"sizing",mode:n.mode,size:Xr.indexOf(a)+1,body:i}},htmlBuilder:function(t,e){var r=e.havingSize(t.size);return Wr(t.body,r,e)},mathmlBuilder:function(t,e){var r=e.havingSize(t.size),a=ke(t.body,r),n=new ve.MathNode("mstyle",a);return n.setAttribute("mathsize",r.sizeMultiplier+"em"),n}}),Qt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(t,e,r){var a=t.parser,n=!1,i=!1,o=r[0]&&Ft(r[0],"ordgroup");if(o)for(var s="",h=0;hr.height+r.depth+i&&(i=(i+c-r.height-r.depth)/2);var u=h.height-r.height-i-l;r.style.paddingLeft=m+"em";var p=Dt.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+u)},{type:"elem",elem:h},{type:"kern",size:l}]},e);if(t.index){var d=e.havingStyle(w.SCRIPTSCRIPT),f=ue(t.index,d,e),g=.6*(p.height-p.depth),x=Dt.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f}]},e),v=Dt.makeSpan(["root"],[x]);return Dt.makeSpan(["mord","sqrt"],[v,p],e)}return Dt.makeSpan(["mord","sqrt"],[p],e)},mathmlBuilder:function(t,e){var r=t.body,a=t.index;return a?new ve.MathNode("mroot",[Me(r,e),Me(a,e)]):new ve.MathNode("msqrt",[Me(r,e)])}});var $r={display:w.DISPLAY,text:w.TEXT,script:w.SCRIPT,scriptscript:w.SCRIPTSCRIPT};Qt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(t,e){var r=t.breakOnTokenText,a=t.funcName,n=t.parser,i=n.parseExpression(!0,r),o=a.slice(1,a.length-5);return{type:"styling",mode:n.mode,style:o,body:i}},htmlBuilder:function(t,e){var r=$r[t.style],a=e.havingStyle(r).withFont("");return Wr(t.body,a,e)},mathmlBuilder:function(t,e){var r=$r[t.style],a=e.havingStyle(r),n=ke(t.body,a),i=new ve.MathNode("mstyle",n),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[t.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}}),te({type:"supsub",htmlBuilder:function(t,e){var r=function(t,e){var r=t.base;return r?"op"===r.type?r.limits&&(e.style.size===w.DISPLAY.size||r.alwaysHandleSupSub)?Vr:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(e.style.size===w.DISPLAY.size||r.limits)?_r:null:"accent"===r.type?c.isCharacterBox(r.base)?Re:null:"horizBrace"===r.type&&!t.sub===r.isOver?Lr:null:null}(t,e);if(r)return r(t,e);var a,n,i,o=t.base,s=t.sup,h=t.sub,l=ue(o,e),m=e.fontMetrics(),u=0,p=0,d=o&&c.isCharacterBox(o);if(s){var f=e.havingStyle(e.style.sup());a=ue(s,f,e),d||(u=l.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(h){var g=e.havingStyle(e.style.sub());n=ue(h,g,e),d||(p=l.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}i=e.style===w.DISPLAY?m.sup1:e.style.cramped?m.sup3:m.sup2;var x,v=e.sizeMultiplier,b=.5/m.ptPerEm/v+"em",y=null;if(n){var k=t.base&&"op"===t.base.type&&t.base.name&&("\\oiint"===t.base.name||"\\oiiint"===t.base.name);(l instanceof E||k)&&(y=-l.italic+"em")}if(a&&n){u=Math.max(u,i,a.depth+.25*m.xHeight),p=Math.max(p,m.sub2);var S=4*m.defaultRuleThickness;if(u-a.depth-(n.height-p)0&&(u+=M,p-=M)}var z=[{type:"elem",elem:n,shift:p,marginRight:b,marginLeft:y},{type:"elem",elem:a,shift:-u,marginRight:b}];x=Dt.makeVList({positionType:"individualShift",children:z},e)}else if(n){p=Math.max(p,m.sub1,n.height-.8*m.xHeight);var A=[{type:"elem",elem:n,marginLeft:y,marginRight:b}];x=Dt.makeVList({positionType:"shift",positionData:p,children:A},e)}else{if(!a)throw new Error("supsub must have either sup or sub.");u=Math.max(u,i,a.depth+.25*m.xHeight),x=Dt.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:a,marginRight:b}]},e)}var T=me(l,"right")||"mord";return Dt.makeSpan([T],[l,Dt.makeSpan(["msupsub"],[x])],e)},mathmlBuilder:function(t,e){var r,a=!1,n=Vt(t.base,"horizBrace");n&&!!t.sup===n.isOver&&(a=!0,r=n.isOver),!t.base||"op"!==t.base.type&&"operatorname"!==t.base.type||(t.base.parentIsSupSub=!0);var i,o=[Me(t.base,e)];if(t.sub&&o.push(Me(t.sub,e)),t.sup&&o.push(Me(t.sup,e)),a)i=r?"mover":"munder";else if(t.sub)if(t.sup){var s=t.base;i=s&&"op"===s.type&&s.limits&&e.style===w.DISPLAY||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(e.style===w.DISPLAY||s.limits)?"munderover":"msubsup"}else{var h=t.base;i=h&&"op"===h.type&&h.limits&&(e.style===w.DISPLAY||h.alwaysHandleSupSub)||h&&"operatorname"===h.type&&h.alwaysHandleSupSub&&(h.limits||e.style===w.DISPLAY)?"munder":"msub"}else{var l=t.base;i=l&&"op"===l.type&&l.limits&&(e.style===w.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||e.style===w.DISPLAY)?"mover":"msup"}return new ve.MathNode(i,o)}}),te({type:"atom",htmlBuilder:function(t,e){return Dt.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder:function(t,e){var r=new ve.MathNode("mo",[be(t.text,t.mode)]);if("bin"===t.family){var a=we(t,e);"bold-italic"===a&&r.setAttribute("mathvariant",a)}else"punct"===t.family?r.setAttribute("separator","true"):"open"!==t.family&&"close"!==t.family||r.setAttribute("stretchy","false");return r}});var jr={mi:"italic",mn:"normal",mtext:"normal"};te({type:"mathord",htmlBuilder:function(t,e){return Dt.makeOrd(t,e,"mathord")},mathmlBuilder:function(t,e){var r=new ve.MathNode("mi",[be(t.text,t.mode,e)]),a=we(t,e)||"italic";return a!==jr[r.type]&&r.setAttribute("mathvariant",a),r}}),te({type:"textord",htmlBuilder:function(t,e){return Dt.makeOrd(t,e,"textord")},mathmlBuilder:function(t,e){var r,a=be(t.text,t.mode,e),n=we(t,e)||"normal";return r="text"===t.mode?new ve.MathNode("mtext",[a]):/[0-9]/.test(t.text)?new ve.MathNode("mn",[a]):"\\prime"===t.text?new ve.MathNode("mo",[a]):new ve.MathNode("mi",[a]),n!==jr[r.type]&&r.setAttribute("mathvariant",n),r}});var Zr={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Kr={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};te({type:"spacing",htmlBuilder:function(t,e){if(Kr.hasOwnProperty(t.text)){var r=Kr[t.text].className||"";if("text"===t.mode){var a=Dt.makeOrd(t,e,"textord");return a.classes.push(r),a}return Dt.makeSpan(["mspace",r],[Dt.mathsym(t.text,t.mode,e)],e)}if(Zr.hasOwnProperty(t.text))return Dt.makeSpan(["mspace",Zr[t.text]],[],e);throw new o('Unknown type of space "'+t.text+'"')},mathmlBuilder:function(t,e){if(!Kr.hasOwnProperty(t.text)){if(Zr.hasOwnProperty(t.text))return new ve.MathNode("mspace");throw new o('Unknown type of space "'+t.text+'"')}return new ve.MathNode("mtext",[new ve.TextNode(" ")])}});var Jr=function(){var t=new ve.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};te({type:"tag",mathmlBuilder:function(t,e){var r=new ve.MathNode("mtable",[new ve.MathNode("mtr",[Jr(),new ve.MathNode("mtd",[Se(t.body,e)]),Jr(),new ve.MathNode("mtd",[Se(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var Qr={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},ta={"\\textbf":"textbf","\\textmd":"textmd"},ea={"\\textit":"textit","\\textup":"textup"},ra=function(t,e){var r=t.font;return r?Qr[r]?e.withTextFontFamily(Qr[r]):ta[r]?e.withTextFontWeight(ta[r]):e.withTextFontShape(ea[r]):e};Qt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],greediness:2,allowedInText:!0},handler:function(t,e){var r=t.parser,a=t.funcName,n=e[0];return{type:"text",mode:r.mode,body:ee(n),font:a}},htmlBuilder:function(t,e){var r=ra(t,e),a=se(t.body,r,!0);return Dt.makeSpan(["mord","text"],Dt.tryCombineChars(a),r)},mathmlBuilder:function(t,e){var r=ra(t,e);return Se(t.body,r)}}),Qt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(t,e){return{type:"underline",mode:t.parser.mode,body:e[0]}},htmlBuilder:function(t,e){var r=ue(t.body,e),a=Dt.makeLineSpan("underline-line",e),n=e.fontMetrics().defaultRuleThickness,i=Dt.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:n},{type:"elem",elem:a},{type:"kern",size:3*n},{type:"elem",elem:r}]},e);return Dt.makeSpan(["mord","underline"],[i],e)},mathmlBuilder:function(t,e){var r=new ve.MathNode("mo",[new ve.TextNode("‾")]);r.setAttribute("stretchy","true");var a=new ve.MathNode("munder",[Me(t.body,e),r]);return a.setAttribute("accentunder","true"),a}}),Qt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(t,e,r){throw new o("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(t,e){for(var r=aa(t),a=[],n=e.havingStyle(e.style.text()),i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=e)}else{var n=this.undefStack[this.undefStack.length-1];n&&!n.hasOwnProperty(t)&&(n[t]=this.current[t])}this.current[t]=e},t}(),la={},ma=la;function ca(t,e){la[t]=e}ca("\\@firstoftwo",(function(t){return{tokens:t.consumeArgs(2)[0],numArgs:0}})),ca("\\@secondoftwo",(function(t){return{tokens:t.consumeArgs(2)[1],numArgs:0}})),ca("\\@ifnextchar",(function(t){var e=t.consumeArgs(3),r=t.future();return 1===e[0].length&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}})),ca("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ca("\\TextOrMath",(function(t){var e=t.consumeArgs(2);return"text"===t.mode?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}}));var ua={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ca("\\char",(function(t){var e,r=t.popToken(),a="";if("'"===r.text)e=8,r=t.popToken();else if('"'===r.text)e=16,r=t.popToken();else if("`"===r.text)if("\\"===(r=t.popToken()).text[0])a=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new o("\\char` missing argument");a=r.text.charCodeAt(0)}else e=10;if(e){if(null==(a=ua[r.text])||a>=e)throw new o("Invalid base-"+e+" digit "+r.text);for(var n;null!=(n=ua[t.future().text])&&n":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};ca("\\dots",(function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in fa?e=fa[r]:("\\not"===r.substr(0,4)||r in $.math&&c.contains(["bin","rel"],$.math[r].group))&&(e="\\dotsb"),e}));var ga={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ca("\\dotso",(function(t){return t.future().text in ga?"\\ldots\\,":"\\ldots"})),ca("\\dotsc",(function(t){var e=t.future().text;return e in ga&&","!==e?"\\ldots\\,":"\\ldots"})),ca("\\cdots",(function(t){return t.future().text in ga?"\\@cdots\\,":"\\@cdots"})),ca("\\dotsb","\\cdots"),ca("\\dotsm","\\cdots"),ca("\\dotsi","\\!\\cdots"),ca("\\dotsx","\\ldots\\,"),ca("\\DOTSI","\\relax"),ca("\\DOTSB","\\relax"),ca("\\DOTSX","\\relax"),ca("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ca("\\,","\\tmspace+{3mu}{.1667em}"),ca("\\thinspace","\\,"),ca("\\>","\\mskip{4mu}"),ca("\\:","\\tmspace+{4mu}{.2222em}"),ca("\\medspace","\\:"),ca("\\;","\\tmspace+{5mu}{.2777em}"),ca("\\thickspace","\\;"),ca("\\!","\\tmspace-{3mu}{.1667em}"),ca("\\negthinspace","\\!"),ca("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ca("\\negthickspace","\\tmspace-{5mu}{.277em}"),ca("\\enspace","\\kern.5em "),ca("\\enskip","\\hskip.5em\\relax"),ca("\\quad","\\hskip1em\\relax"),ca("\\qquad","\\hskip2em\\relax"),ca("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ca("\\tag@paren","\\tag@literal{({#1})}"),ca("\\tag@literal",(function(t){if(t.macros.get("\\df@tag"))throw new o("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),ca("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ca("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ca("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ca("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ca("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),ca("\\\\","\\newline"),ca("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var xa=F["Main-Regular"]["T".charCodeAt(0)][1]-.7*F["Main-Regular"]["A".charCodeAt(0)][1]+"em";ca("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+xa+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),ca("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+xa+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),ca("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ca("\\@hspace","\\hskip #1\\relax"),ca("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ca("\\ordinarycolon",":"),ca("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ca("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ca("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ca("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ca("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ca("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ca("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ca("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ca("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ca("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ca("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ca("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ca("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ca("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ca("∷","\\dblcolon"),ca("∹","\\eqcolon"),ca("≔","\\coloneqq"),ca("≕","\\eqqcolon"),ca("⩴","\\Coloneqq"),ca("\\ratio","\\vcentcolon"),ca("\\coloncolon","\\dblcolon"),ca("\\colonequals","\\coloneqq"),ca("\\coloncolonequals","\\Coloneqq"),ca("\\equalscolon","\\eqqcolon"),ca("\\equalscoloncolon","\\Eqqcolon"),ca("\\colonminus","\\coloneq"),ca("\\coloncolonminus","\\Coloneq"),ca("\\minuscolon","\\eqcolon"),ca("\\minuscoloncolon","\\Eqcolon"),ca("\\coloncolonapprox","\\Colonapprox"),ca("\\coloncolonsim","\\Colonsim"),ca("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ca("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ca("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ca("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ca("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),ca("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ca("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ca("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),ca("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),ca("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),ca("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),ca("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),ca("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),ca("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),ca("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),ca("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),ca("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),ca("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),ca("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),ca("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),ca("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),ca("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),ca("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),ca("⟦","\\llbracket"),ca("⟧","\\rrbracket"),ca("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),ca("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),ca("⦃","\\lBrace"),ca("⦄","\\rBrace"),ca("\\darr","\\downarrow"),ca("\\dArr","\\Downarrow"),ca("\\Darr","\\Downarrow"),ca("\\lang","\\langle"),ca("\\rang","\\rangle"),ca("\\uarr","\\uparrow"),ca("\\uArr","\\Uparrow"),ca("\\Uarr","\\Uparrow"),ca("\\N","\\mathbb{N}"),ca("\\R","\\mathbb{R}"),ca("\\Z","\\mathbb{Z}"),ca("\\alef","\\aleph"),ca("\\alefsym","\\aleph"),ca("\\Alpha","\\mathrm{A}"),ca("\\Beta","\\mathrm{B}"),ca("\\bull","\\bullet"),ca("\\Chi","\\mathrm{X}"),ca("\\clubs","\\clubsuit"),ca("\\cnums","\\mathbb{C}"),ca("\\Complex","\\mathbb{C}"),ca("\\Dagger","\\ddagger"),ca("\\diamonds","\\diamondsuit"),ca("\\empty","\\emptyset"),ca("\\Epsilon","\\mathrm{E}"),ca("\\Eta","\\mathrm{H}"),ca("\\exist","\\exists"),ca("\\harr","\\leftrightarrow"),ca("\\hArr","\\Leftrightarrow"),ca("\\Harr","\\Leftrightarrow"),ca("\\hearts","\\heartsuit"),ca("\\image","\\Im"),ca("\\infin","\\infty"),ca("\\Iota","\\mathrm{I}"),ca("\\isin","\\in"),ca("\\Kappa","\\mathrm{K}"),ca("\\larr","\\leftarrow"),ca("\\lArr","\\Leftarrow"),ca("\\Larr","\\Leftarrow"),ca("\\lrarr","\\leftrightarrow"),ca("\\lrArr","\\Leftrightarrow"),ca("\\Lrarr","\\Leftrightarrow"),ca("\\Mu","\\mathrm{M}"),ca("\\natnums","\\mathbb{N}"),ca("\\Nu","\\mathrm{N}"),ca("\\Omicron","\\mathrm{O}"),ca("\\plusmn","\\pm"),ca("\\rarr","\\rightarrow"),ca("\\rArr","\\Rightarrow"),ca("\\Rarr","\\Rightarrow"),ca("\\real","\\Re"),ca("\\reals","\\mathbb{R}"),ca("\\Reals","\\mathbb{R}"),ca("\\Rho","\\mathrm{P}"),ca("\\sdot","\\cdot"),ca("\\sect","\\S"),ca("\\spades","\\spadesuit"),ca("\\sub","\\subset"),ca("\\sube","\\subseteq"),ca("\\supe","\\supseteq"),ca("\\Tau","\\mathrm{T}"),ca("\\thetasym","\\vartheta"),ca("\\weierp","\\wp"),ca("\\Zeta","\\mathrm{Z}"),ca("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ca("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ca("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ca("\\blue","\\textcolor{##6495ed}{#1}"),ca("\\orange","\\textcolor{##ffa500}{#1}"),ca("\\pink","\\textcolor{##ff00af}{#1}"),ca("\\red","\\textcolor{##df0030}{#1}"),ca("\\green","\\textcolor{##28ae7b}{#1}"),ca("\\gray","\\textcolor{gray}{#1}"),ca("\\purple","\\textcolor{##9d38bd}{#1}"),ca("\\blueA","\\textcolor{##ccfaff}{#1}"),ca("\\blueB","\\textcolor{##80f6ff}{#1}"),ca("\\blueC","\\textcolor{##63d9ea}{#1}"),ca("\\blueD","\\textcolor{##11accd}{#1}"),ca("\\blueE","\\textcolor{##0c7f99}{#1}"),ca("\\tealA","\\textcolor{##94fff5}{#1}"),ca("\\tealB","\\textcolor{##26edd5}{#1}"),ca("\\tealC","\\textcolor{##01d1c1}{#1}"),ca("\\tealD","\\textcolor{##01a995}{#1}"),ca("\\tealE","\\textcolor{##208170}{#1}"),ca("\\greenA","\\textcolor{##b6ffb0}{#1}"),ca("\\greenB","\\textcolor{##8af281}{#1}"),ca("\\greenC","\\textcolor{##74cf70}{#1}"),ca("\\greenD","\\textcolor{##1fab54}{#1}"),ca("\\greenE","\\textcolor{##0d923f}{#1}"),ca("\\goldA","\\textcolor{##ffd0a9}{#1}"),ca("\\goldB","\\textcolor{##ffbb71}{#1}"),ca("\\goldC","\\textcolor{##ff9c39}{#1}"),ca("\\goldD","\\textcolor{##e07d10}{#1}"),ca("\\goldE","\\textcolor{##a75a05}{#1}"),ca("\\redA","\\textcolor{##fca9a9}{#1}"),ca("\\redB","\\textcolor{##ff8482}{#1}"),ca("\\redC","\\textcolor{##f9685d}{#1}"),ca("\\redD","\\textcolor{##e84d39}{#1}"),ca("\\redE","\\textcolor{##bc2612}{#1}"),ca("\\maroonA","\\textcolor{##ffbde0}{#1}"),ca("\\maroonB","\\textcolor{##ff92c6}{#1}"),ca("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ca("\\maroonD","\\textcolor{##ca337c}{#1}"),ca("\\maroonE","\\textcolor{##9e034e}{#1}"),ca("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ca("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ca("\\purpleC","\\textcolor{##aa87ff}{#1}"),ca("\\purpleD","\\textcolor{##7854ab}{#1}"),ca("\\purpleE","\\textcolor{##543b78}{#1}"),ca("\\mintA","\\textcolor{##f5f9e8}{#1}"),ca("\\mintB","\\textcolor{##edf2df}{#1}"),ca("\\mintC","\\textcolor{##e0e5cc}{#1}"),ca("\\grayA","\\textcolor{##f6f7f7}{#1}"),ca("\\grayB","\\textcolor{##f0f1f2}{#1}"),ca("\\grayC","\\textcolor{##e3e5e6}{#1}"),ca("\\grayD","\\textcolor{##d6d8da}{#1}"),ca("\\grayE","\\textcolor{##babec2}{#1}"),ca("\\grayF","\\textcolor{##888d93}{#1}"),ca("\\grayG","\\textcolor{##626569}{#1}"),ca("\\grayH","\\textcolor{##3b3e40}{#1}"),ca("\\grayI","\\textcolor{##21242c}{#1}"),ca("\\kaBlue","\\textcolor{##314453}{#1}"),ca("\\kaGreen","\\textcolor{##71B307}{#1}");var va={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},ba=function(){function t(t,e,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=e,this.expansionCount=0,this.feed(t),this.macros=new ha(ma,e.macros),this.mode=r,this.stack=[]}var e=t.prototype;return e.feed=function(t){this.lexer=new sa(t,this.settings)},e.switchMode=function(t){this.mode=t},e.beginGroup=function(){this.macros.beginGroup()},e.endGroup=function(){this.macros.endGroup()},e.future=function(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},e.popToken=function(){return this.future(),this.stack.pop()},e.pushToken=function(t){this.stack.push(t)},e.pushTokens=function(t){var e;(e=this.stack).push.apply(e,t)},e.consumeSpaces=function(){for(;" "===this.future().text;)this.stack.pop()},e.consumeArgs=function(t){for(var e=[],r=0;rthis.settings.maxExpand)throw new o("Too many expansions: infinite loop or need to increase maxExpand setting");var a=r.tokens;if(r.numArgs)for(var n=this.consumeArgs(r.numArgs),i=(a=a.slice()).length-1;i>=0;--i){var s=a[i];if("#"===s.text){if(0===i)throw new o("Incomplete placeholder at end of macro body",s);if("#"===(s=a[--i]).text)a.splice(i+1,1);else{if(!/^[1-9]$/.test(s.text))throw new o("Not a valid argument number",s);var h;(h=a).splice.apply(h,[i,2].concat(n[+s.text-1]))}}}return this.pushTokens(a),a},e.expandAfterFuture=function(){return this.expandOnce(),this.future()},e.expandNextToken=function(){for(;;){var t=this.expandOnce();if(t instanceof n){if("\\relax"!==t.text)return this.stack.pop();this.stack.pop()}}throw new Error},e.expandMacro=function(t){if(this.macros.get(t)){var e=[],r=this.stack.length;for(this.pushToken(new n(t));this.stack.length>r;)this.expandOnce()instanceof n&&e.push(this.stack.pop());return e}},e.expandMacroAsText=function(t){var e=this.expandMacro(t);return e?e.map((function(t){return t.text})).join(""):e},e._getExpansion=function(t){var e=this.macros.get(t);if(null==e)return e;var r="function"==typeof e?e(this):e;if("string"==typeof r){var a=0;if(-1!==r.indexOf("#"))for(var n=r.replace(/##/g,"");-1!==n.indexOf("#"+(a+1));)++a;for(var i=new sa(r,this.settings),o=[],s=i.lex();"EOF"!==s.text;)o.push(s),s=i.lex();return o.reverse(),{tokens:o,numArgs:a}}return r},e.isDefined=function(t){return this.macros.has(t)||na.hasOwnProperty(t)||$.math.hasOwnProperty(t)||$.text.hasOwnProperty(t)||va.hasOwnProperty(t)},t}(),ya={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"}},wa={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","č":"č","ĉ":"ĉ","ċ":"ċ","ď":"ď","ḋ":"ḋ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ĺ":"ĺ","ľ":"ľ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ď":"Ď","Ḋ":"Ḋ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ĺ":"Ĺ","Ľ":"Ľ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ť":"Ť","Ṫ":"Ṫ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"},ka=function(){function t(t,e){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new ba(t,e,this.mode),this.settings=e,this.leftrightDepth=0}var e=t.prototype;return e.expect=function(t,e){if(void 0===e&&(e=!0),this.fetch().text!==t)throw new o("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());e&&this.consume()},e.consume=function(){this.nextToken=null},e.fetch=function(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},e.switchMode=function(t){this.mode=t,this.gullet.switchMode(t)},e.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var t=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),t},e.parseExpression=function(e,r){for(var a=[];;){"math"===this.mode&&this.consumeSpaces();var n=this.fetch();if(-1!==t.endOfExpression.indexOf(n.text))break;if(r&&n.text===r)break;if(e&&na[n.text]&&na[n.text].infix)break;var i=this.parseAtom(r);if(!i)break;a.push(i)}return"text"===this.mode&&this.formLigatures(a),this.handleInfixNodes(a)},e.handleInfixNodes=function(t){for(var e,r=-1,a=0;a0&&!l||0===s&&!l&&"math"===this.mode,c=this.parseGroupOfType("argument to '"+t+"'",h,l,a,m);if(!c){if(l){i.push(null);continue}throw new o("Expected group after '"+t+"'",this.fetch())}(l?i:n).push(c)}return{args:n,optArgs:i}},e.parseGroupOfType=function(t,e,r,a,n){switch(e){case"color":return n&&this.consumeSpaces(),this.parseColorGroup(r);case"size":return n&&this.consumeSpaces(),this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r,n);case"math":case"text":return this.parseGroup(t,r,a,void 0,e,n);case"hbox":var i=this.parseGroup(t,r,a,void 0,"text",n);return i?{type:"styling",mode:i.mode,body:[i],style:"text"}:i;case"raw":if(n&&this.consumeSpaces(),r&&"{"===this.fetch().text)return null;var s=this.parseStringGroup("raw",r,!0);if(s)return{type:"raw",mode:"text",string:s.text};throw new o("Expected raw group",this.fetch());case"original":case null:case void 0:return this.parseGroup(t,r,a,void 0,void 0,n);default:throw new o("Unknown group type as "+t,this.fetch())}},e.consumeSpaces=function(){for(;" "===this.fetch().text;)this.consume()},e.parseStringGroup=function(t,e,r){var a=e?"[":"{",n=e?"]":"}",i=this.fetch();if(i.text!==a){if(e)return null;if(r&&"EOF"!==i.text&&/[^{}[\]]/.test(i.text))return this.consume(),i}var s=this.mode;this.mode="text",this.expect(a);for(var h,l="",m=this.fetch(),c=0,u=m;(h=this.fetch()).text!==n||r&&c>0;){switch(h.text){case"EOF":throw new o("Unexpected end of input in "+t,m.range(u,l));case a:c++;break;case n:c--}l+=(u=h).text,this.consume()}return this.expect(n),this.mode=s,m.range(u,l)},e.parseRegexGroup=function(t,e){var r=this.mode;this.mode="text";for(var a,n=this.fetch(),i=n,s="";"EOF"!==(a=this.fetch()).text&&t.test(s+a.text);)s+=(i=a).text,this.consume();if(""===s)throw new o("Invalid "+e+": '"+n.text+"'",n);return this.mode=r,n.range(i,s)},e.parseColorGroup=function(t){var e=this.parseStringGroup("color",t);if(!e)return null;var r=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(e.text);if(!r)throw new o("Invalid color: '"+e.text+"'",e);var a=r[0];return/^[0-9a-f]{6}$/i.test(a)&&(a="#"+a),{type:"color-token",mode:this.mode,color:a}},e.parseSizeGroup=function(t){var e,r=!1;if(!(e=t||"{"===this.fetch().text?this.parseStringGroup("size",t):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;t||0!==e.text.length||(e.text="0pt",r=!0);var a=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e.text);if(!a)throw new o("Invalid size: '"+e.text+"'",e);var n={number:+(a[1]+a[2]),unit:a[3]};if(!At(n))throw new o("Invalid unit: '"+n.unit+"'",e);return{type:"size",mode:this.mode,value:n,isBlank:r}},e.parseUrlGroup=function(t,e){this.gullet.lexer.setCatcode("%",13);var r=this.parseStringGroup("url",t,!0);if(this.gullet.lexer.setCatcode("%",14),!r)return null;var a=r.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}},e.parseGroup=function(e,r,n,i,s,h){var l=this.mode;s&&this.switchMode(s),h&&this.consumeSpaces();var m,c=this.fetch(),u=c.text;if(r?"["===u:"{"===u||"\\begingroup"===u){this.consume();var p=t.endOfGroup[u];this.gullet.beginGroup();var d=this.parseExpression(!1,p),f=this.fetch();this.expect(p),this.gullet.endGroup(),m={type:"ordgroup",mode:this.mode,loc:a.range(c,f),body:d,semisimple:"\\begingroup"===u||void 0}}else if(r)m=null;else if(null==(m=this.parseFunction(i,e,n)||this.parseSymbol())&&"\\"===u[0]&&!va.hasOwnProperty(u)){if(this.settings.throwOnError)throw new o("Undefined control sequence: "+u,c);m=this.formatUnsupportedCmd(u),this.consume()}return s&&this.switchMode(l),m},e.formLigatures=function(t){for(var e=t.length-1,r=0;r=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+e[0]+'" used in math mode',t);var h,l=$[this.mode][e].group,m=a.range(t);if(_.hasOwnProperty(l)){var c=l;h={type:"atom",mode:this.mode,family:c,loc:m,text:e}}else h={type:l,mode:this.mode,loc:m,text:e};i=h}else{if(!(e.charCodeAt(0)>=128))return null;this.settings.strict&&(M(e.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+e[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+e[0]+'" ('+e.charCodeAt(0)+")",t)),i={type:"textord",mode:"text",loc:a.range(t),text:e}}if(this.consume(),s)for(var u=0;u/g,p=//g;$docsify.plugins=[].concat((function(t){t.beforeEach(t=>{let e=t.replace(/(.*)<\/code>/g,(function(t,e){return`${e.replace(/`/g,"c194a9ec")}`})).replace(/\$`\$/g,"c194a9ed").replace(/\\`\{/g,"c194a9ee").replace(/\\\$/g,"c194a9eb").replace(/`[^`]*`/g,(function(t){return t.replace(/\$/g,"c194a9ef")})).replace(h,"`");return e=e.replace(l,"$ `$").replace(m,"\\`{"),e=e.replace(/(\$\$)([\s\S]*?)(\$\$)/g,(function(t,e,r){return"\x3c!-- begin-block-katex"+r+"end-block-katex--\x3e"})).replace(/(\$)([\s\S]*?)(\$)/g,(function(t,e,r){return"c194a9eg\x3c!-- begin-inline-katex"+r.replace(s,"\\$")+"end-inline-katex--\x3e"})).replace(s,"\\$"),e}),t.afterEach((function(t,e){let r=t.replace(u,(function(t,e){return n.a.renderToString(e,i)}));r=r.replace(p,(function(t,e){return n.a.renderToString(e,o)})),e(r.replace(c,"$"))}))}),$docsify.plugins)}]);
\ No newline at end of file
diff --git a/asset/docsify-quick-page.css b/asset/docsify-quick-page.css
deleted file mode 100644
index 2cbba5b7..00000000
--- a/asset/docsify-quick-page.css
+++ /dev/null
@@ -1,37 +0,0 @@
-#prev-page-button {
- position:fixed;
- top:140px;
- width: 35px;
- height: 35px;
- right: 15px;
- background-color: transparent;
- background-image: url(left.svg);
- background-repeat: no-repeat;
- background-size: cover;
- border:0;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- outline:none;
- cursor: pointer;
-}
-
-#next-page-button {
- position:fixed;
- top:180px;
- width:35px;
- height:35px;
- right:15px;
- background-color: transparent;
- background-image: url(right.svg);
- background-repeat: no-repeat;
- background-size: cover;
- border:0;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- outline:none;
- cursor: pointer;
-}
\ No newline at end of file
diff --git a/asset/docsify-quick-page.js b/asset/docsify-quick-page.js
deleted file mode 100644
index d472eeb6..00000000
--- a/asset/docsify-quick-page.js
+++ /dev/null
@@ -1,42 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- var prevBtn = document.createElement("div")
- prevBtn.id = "prev-page-button"
- document.body.appendChild(prevBtn)
- var nextBtn = document.createElement("div");
- nextBtn.id = "next-page-button"
- document.body.appendChild(nextBtn)
-
- var links = null
- var linkMap = null
- var getCurIdx = function() {
- if (!links) {
- links = Array
- .from(document.querySelectorAll(".sidebar-nav a"))
- .map(x => x.href)
- linkMap = {}
- links.forEach((x, i) => linkMap[x] = i)
- }
-
- var elem = document.querySelector(".active a")
- var curIdx = elem? linkMap[elem.href]: -1
- return curIdx
- }
-
- prevBtn.addEventListener('click', function () {
- if (!document.body.classList.contains('ready'))
- return
- var curIdx = getCurIdx()
- location.href = curIdx == -1?
- links[0]:
- links[(curIdx - 1 + links.length) % links.length]
- document.body.scrollIntoView()
- }, false)
-
- nextBtn.addEventListener('click', function () {
- if (!document.body.classList.contains('ready'))
- return
- var curIdx = getCurIdx()
- location.href = links[(curIdx + 1) % links.length]
- document.body.scrollIntoView()
- }, false)
-})
\ No newline at end of file
diff --git a/asset/docsify-sidebar-collapse.min.js b/asset/docsify-sidebar-collapse.min.js
deleted file mode 100644
index 2b067c7e..00000000
--- a/asset/docsify-sidebar-collapse.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){("object"!=typeof exports||"undefined"==typeof module)&&"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(e,n){var t,a=(n=void 0===n?{}:n).insertAt;e&&"undefined"!=typeof document&&(t=document.head||document.getElementsByTagName("head")[0],(n=document.createElement("style")).type="text/css","top"===a&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)))}var t;function a(e){e&&null!=t&&(e=e.getBoundingClientRect().top,document.querySelector(".sidebar").scrollBy(0,e-t))}function n(){requestAnimationFrame(function(){var e=document.querySelector(".app-sub-sidebar > .active");if(e)for(e.parentNode.parentNode.querySelectorAll(".app-sub-sidebar").forEach(function(e){return e.classList.remove("open")});e.parentNode.classList.contains("app-sub-sidebar")&&!e.parentNode.classList.contains("open");)e.parentNode.classList.add("open"),e=e.parentNode})}function o(e){t=e.target.getBoundingClientRect().top;var n=d(e.target,"LI",2);n&&(n.classList.contains("open")?(n.classList.remove("open"),setTimeout(function(){n.classList.add("collapse")},0)):(function(e){if(e)for(e.classList.remove("open","active");e&&"sidebar-nav"!==e.className&&e.parentNode;)"LI"!==e.parentNode.tagName&&"app-sub-sidebar"!==e.parentNode.className||e.parentNode.classList.remove("open"),e=e.parentNode}(s()),i(n),setTimeout(function(){n.classList.remove("collapse")},0)),a(n))}function s(){var e=document.querySelector(".sidebar-nav .active");return e||(e=d(document.querySelector('.sidebar-nav a[href="'.concat(decodeURIComponent(location.hash).replace(/ /gi,"%20"),'"]')),"LI",2))&&e.classList.add("active"),e}function i(e){if(e)for(e.classList.add("open","active");e&&"sidebar-nav"!==e.className&&e.parentNode;)"LI"!==e.parentNode.tagName&&"app-sub-sidebar"!==e.parentNode.className||e.parentNode.classList.add("open"),e=e.parentNode}function d(e,n,t){if(e&&e.tagName===n)return e;for(var a=0;e;){if(t<++a)return;if(e.parentNode.tagName===n)return e.parentNode;e=e.parentNode}}e(".sidebar-nav > ul > li ul {\n display: none;\n}\n\n.app-sub-sidebar {\n display: none;\n}\n\n.app-sub-sidebar.open {\n display: block;\n}\n\n.sidebar-nav .open > ul:not(.app-sub-sidebar),\n.sidebar-nav .active:not(.collapse) > ul {\n display: block;\n}\n\n/* 抖动 */\n.sidebar-nav li.open:not(.collapse) > ul {\n display: block;\n}\n\n.active + ul.app-sub-sidebar {\n display: block;\n}\n"),document.addEventListener("scroll",n);e("@media screen and (max-width: 768px) {\n /* 移动端适配 */\n .markdown-section {\n max-width: none;\n padding: 16px;\n }\n /* 改变原来按钮热区大小 */\n .sidebar-toggle {\n padding: 0 0 10px 10px;\n }\n /* my pin */\n .sidebar-pin {\n appearance: none;\n outline: none;\n position: fixed;\n bottom: 0;\n border: none;\n width: 40px;\n height: 40px;\n background: transparent;\n }\n}\n");var r,c="DOCSIFY_SIDEBAR_PIN_FLAG";function l(){var e="true"===(e=localStorage.getItem(c));localStorage.setItem(c,!e),e?(document.querySelector(".sidebar").style.transform="translateX(0)",document.querySelector(".content").style.transform="translateX(0)"):(document.querySelector(".sidebar").style.transform="translateX(300px)",document.querySelector(".content").style.transform="translateX(300px)")}768 ul"),1),a(t),n(e)}),e.ready(function(){document.querySelector(".sidebar-nav").addEventListener("click",o)})})});
\ No newline at end of file
diff --git a/asset/docsify.min.js b/asset/docsify.min.js
deleted file mode 100644
index 13ee7221..00000000
--- a/asset/docsify.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){function s(n){var r=Object.create(null);return function(e){var t=c(e)?e:JSON.stringify(e);return r[t]||(r[t]=n(e))}}var a=s(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),l=Object.prototype.hasOwnProperty,f=Object.assign||function(e){for(var t=arguments,n=1;n/gm),Ve=$(/^data-[\-\w.\u00B7-\uFFFF]/),Xe=$(/^aria-[\-\w]+$/),Ke=$(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qe=$(/^(?:\w+script|data):/i),Je=$(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function tt(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t"+e;else{var r=Re(e,/^[\s]+/);n=r&&r[0]}var i=y?y.createHTML(e):e;if(o)try{t=(new m).parseFromString(i,"text/html")}catch(e){}if(s&&Ne(U,["title"]),!t||!t.documentElement){var a=(t=w.createHTMLDocument("")).body;a.parentNode.removeChild(a.parentNode.firstElementChild),a.outerHTML=i}return e&&n&&t.body.insertBefore(l.createTextNode(n),t.body.childNodes[0]||null),S.call(t,X?"html":"body")[0]}var F=Ye,z=Ge,O=Ve,M=Xe,N=Qe,P=Je,D=Ke,j=null,H=Ne({},[].concat(tt(De),tt(je),tt(He),tt(Ie),tt(qe))),I=null,q=Ne({},[].concat(tt(Ue),tt(Be),tt(Ze),tt(We))),U=null,B=null,Z=!0,W=!0,Y=!1,G=!1,V=!1,X=!1,K=!1,Q=!1,J=!1,ee=!1,te=!1,ne=!1,re=!0,ie=!0,ae=!1,oe={},se=Ne({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),le=Ne({},["audio","video","img","source","image"]),ce=null,ue=Ne({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),pe=null,de=l.createElement("form");d.isSupported&&(function(){try{$('
$');if(i){if("color"===i[2])n.style.background=i[1]+(i[3]||"");else{var a=i[1];_(n,"add","has-mask"),Q(i[1])||(a=re(this.router.getBasePath(),i[1])),n.style.backgroundImage="url("+a+")",n.style.backgroundSize="cover",n.style.backgroundPosition="center center"}r=r.replace(i[0],"")}this._renderTo(".cover-main",r),W()}else _(n,"remove","show")},Xn._updateRender=function(){!function(e){var t=m(".app-name-link"),n=e.config.nameLink,r=e.route.path;if(t)if(c(e.config.nameLink))t.setAttribute("href",n);else if("object"==typeof n){var i=Object.keys(n).filter(function(e){return-1
-
\ No newline at end of file
diff --git a/asset/fonts/KaTeX_AMS-Regular.ttf b/asset/fonts/KaTeX_AMS-Regular.ttf
deleted file mode 100644
index afcd2eb4..00000000
Binary files a/asset/fonts/KaTeX_AMS-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_AMS-Regular.woff b/asset/fonts/KaTeX_AMS-Regular.woff
deleted file mode 100644
index 4f575152..00000000
Binary files a/asset/fonts/KaTeX_AMS-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_AMS-Regular.woff2 b/asset/fonts/KaTeX_AMS-Regular.woff2
deleted file mode 100644
index b982d6ea..00000000
Binary files a/asset/fonts/KaTeX_AMS-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Caligraphic-Bold.ttf b/asset/fonts/KaTeX_Caligraphic-Bold.ttf
deleted file mode 100644
index f84148db..00000000
Binary files a/asset/fonts/KaTeX_Caligraphic-Bold.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Caligraphic-Bold.woff b/asset/fonts/KaTeX_Caligraphic-Bold.woff
deleted file mode 100644
index ab56ab7f..00000000
Binary files a/asset/fonts/KaTeX_Caligraphic-Bold.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Caligraphic-Bold.woff2 b/asset/fonts/KaTeX_Caligraphic-Bold.woff2
deleted file mode 100644
index 710c2617..00000000
Binary files a/asset/fonts/KaTeX_Caligraphic-Bold.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Caligraphic-Regular.ttf b/asset/fonts/KaTeX_Caligraphic-Regular.ttf
deleted file mode 100644
index 97814db7..00000000
Binary files a/asset/fonts/KaTeX_Caligraphic-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Caligraphic-Regular.woff b/asset/fonts/KaTeX_Caligraphic-Regular.woff
deleted file mode 100644
index aec8a333..00000000
Binary files a/asset/fonts/KaTeX_Caligraphic-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Caligraphic-Regular.woff2 b/asset/fonts/KaTeX_Caligraphic-Regular.woff2
deleted file mode 100644
index ee5193d7..00000000
Binary files a/asset/fonts/KaTeX_Caligraphic-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Fraktur-Bold.ttf b/asset/fonts/KaTeX_Fraktur-Bold.ttf
deleted file mode 100644
index 483a7cdd..00000000
Binary files a/asset/fonts/KaTeX_Fraktur-Bold.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Fraktur-Bold.woff b/asset/fonts/KaTeX_Fraktur-Bold.woff
deleted file mode 100644
index 189fea5e..00000000
Binary files a/asset/fonts/KaTeX_Fraktur-Bold.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Fraktur-Bold.woff2 b/asset/fonts/KaTeX_Fraktur-Bold.woff2
deleted file mode 100644
index dc3bd4c0..00000000
Binary files a/asset/fonts/KaTeX_Fraktur-Bold.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Fraktur-Regular.ttf b/asset/fonts/KaTeX_Fraktur-Regular.ttf
deleted file mode 100644
index 9aa5f674..00000000
Binary files a/asset/fonts/KaTeX_Fraktur-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Fraktur-Regular.woff b/asset/fonts/KaTeX_Fraktur-Regular.woff
deleted file mode 100644
index d01450e9..00000000
Binary files a/asset/fonts/KaTeX_Fraktur-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Fraktur-Regular.woff2 b/asset/fonts/KaTeX_Fraktur-Regular.woff2
deleted file mode 100644
index 7eeba377..00000000
Binary files a/asset/fonts/KaTeX_Fraktur-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-Bold.ttf b/asset/fonts/KaTeX_Main-Bold.ttf
deleted file mode 100644
index dc0185a1..00000000
Binary files a/asset/fonts/KaTeX_Main-Bold.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-Bold.woff b/asset/fonts/KaTeX_Main-Bold.woff
deleted file mode 100644
index acf48e66..00000000
Binary files a/asset/fonts/KaTeX_Main-Bold.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-Bold.woff2 b/asset/fonts/KaTeX_Main-Bold.woff2
deleted file mode 100644
index cf5ababf..00000000
Binary files a/asset/fonts/KaTeX_Main-Bold.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-BoldItalic.ttf b/asset/fonts/KaTeX_Main-BoldItalic.ttf
deleted file mode 100644
index 4346f173..00000000
Binary files a/asset/fonts/KaTeX_Main-BoldItalic.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-BoldItalic.woff b/asset/fonts/KaTeX_Main-BoldItalic.woff
deleted file mode 100644
index d2cfe4e3..00000000
Binary files a/asset/fonts/KaTeX_Main-BoldItalic.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-BoldItalic.woff2 b/asset/fonts/KaTeX_Main-BoldItalic.woff2
deleted file mode 100644
index d0178f42..00000000
Binary files a/asset/fonts/KaTeX_Main-BoldItalic.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-Italic.ttf b/asset/fonts/KaTeX_Main-Italic.ttf
deleted file mode 100644
index f2c3ebae..00000000
Binary files a/asset/fonts/KaTeX_Main-Italic.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-Italic.woff b/asset/fonts/KaTeX_Main-Italic.woff
deleted file mode 100644
index 1184295d..00000000
Binary files a/asset/fonts/KaTeX_Main-Italic.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-Italic.woff2 b/asset/fonts/KaTeX_Main-Italic.woff2
deleted file mode 100644
index aa05e142..00000000
Binary files a/asset/fonts/KaTeX_Main-Italic.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-Regular.ttf b/asset/fonts/KaTeX_Main-Regular.ttf
deleted file mode 100644
index 8acb3654..00000000
Binary files a/asset/fonts/KaTeX_Main-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-Regular.woff b/asset/fonts/KaTeX_Main-Regular.woff
deleted file mode 100644
index 9f8228fc..00000000
Binary files a/asset/fonts/KaTeX_Main-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Main-Regular.woff2 b/asset/fonts/KaTeX_Main-Regular.woff2
deleted file mode 100644
index e3f71eb7..00000000
Binary files a/asset/fonts/KaTeX_Main-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Math-BoldItalic.ttf b/asset/fonts/KaTeX_Math-BoldItalic.ttf
deleted file mode 100644
index a645df64..00000000
Binary files a/asset/fonts/KaTeX_Math-BoldItalic.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Math-BoldItalic.woff b/asset/fonts/KaTeX_Math-BoldItalic.woff
deleted file mode 100644
index 87d4f223..00000000
Binary files a/asset/fonts/KaTeX_Math-BoldItalic.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Math-BoldItalic.woff2 b/asset/fonts/KaTeX_Math-BoldItalic.woff2
deleted file mode 100644
index 83b49962..00000000
Binary files a/asset/fonts/KaTeX_Math-BoldItalic.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Math-Italic.ttf b/asset/fonts/KaTeX_Math-Italic.ttf
deleted file mode 100644
index 9c38359c..00000000
Binary files a/asset/fonts/KaTeX_Math-Italic.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Math-Italic.woff b/asset/fonts/KaTeX_Math-Italic.woff
deleted file mode 100644
index 959746ef..00000000
Binary files a/asset/fonts/KaTeX_Math-Italic.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Math-Italic.woff2 b/asset/fonts/KaTeX_Math-Italic.woff2
deleted file mode 100644
index e3ea522a..00000000
Binary files a/asset/fonts/KaTeX_Math-Italic.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_SansSerif-Bold.ttf b/asset/fonts/KaTeX_SansSerif-Bold.ttf
deleted file mode 100644
index ff108512..00000000
Binary files a/asset/fonts/KaTeX_SansSerif-Bold.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_SansSerif-Bold.woff b/asset/fonts/KaTeX_SansSerif-Bold.woff
deleted file mode 100644
index f0d6ea73..00000000
Binary files a/asset/fonts/KaTeX_SansSerif-Bold.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_SansSerif-Bold.woff2 b/asset/fonts/KaTeX_SansSerif-Bold.woff2
deleted file mode 100644
index 4cf8f146..00000000
Binary files a/asset/fonts/KaTeX_SansSerif-Bold.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_SansSerif-Italic.ttf b/asset/fonts/KaTeX_SansSerif-Italic.ttf
deleted file mode 100644
index 3dd76713..00000000
Binary files a/asset/fonts/KaTeX_SansSerif-Italic.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_SansSerif-Italic.woff b/asset/fonts/KaTeX_SansSerif-Italic.woff
deleted file mode 100644
index 9da0dfe3..00000000
Binary files a/asset/fonts/KaTeX_SansSerif-Italic.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_SansSerif-Italic.woff2 b/asset/fonts/KaTeX_SansSerif-Italic.woff2
deleted file mode 100644
index ce19ae03..00000000
Binary files a/asset/fonts/KaTeX_SansSerif-Italic.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_SansSerif-Regular.ttf b/asset/fonts/KaTeX_SansSerif-Regular.ttf
deleted file mode 100644
index f117cd61..00000000
Binary files a/asset/fonts/KaTeX_SansSerif-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_SansSerif-Regular.woff b/asset/fonts/KaTeX_SansSerif-Regular.woff
deleted file mode 100644
index 6ed98780..00000000
Binary files a/asset/fonts/KaTeX_SansSerif-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_SansSerif-Regular.woff2 b/asset/fonts/KaTeX_SansSerif-Regular.woff2
deleted file mode 100644
index 27611491..00000000
Binary files a/asset/fonts/KaTeX_SansSerif-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Script-Regular.ttf b/asset/fonts/KaTeX_Script-Regular.ttf
deleted file mode 100644
index e6f34542..00000000
Binary files a/asset/fonts/KaTeX_Script-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Script-Regular.woff b/asset/fonts/KaTeX_Script-Regular.woff
deleted file mode 100644
index 4a48e65f..00000000
Binary files a/asset/fonts/KaTeX_Script-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Script-Regular.woff2 b/asset/fonts/KaTeX_Script-Regular.woff2
deleted file mode 100644
index b0aed195..00000000
Binary files a/asset/fonts/KaTeX_Script-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size1-Regular.ttf b/asset/fonts/KaTeX_Size1-Regular.ttf
deleted file mode 100644
index 37faa0f9..00000000
Binary files a/asset/fonts/KaTeX_Size1-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size1-Regular.woff b/asset/fonts/KaTeX_Size1-Regular.woff
deleted file mode 100644
index 0832f7a4..00000000
Binary files a/asset/fonts/KaTeX_Size1-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size1-Regular.woff2 b/asset/fonts/KaTeX_Size1-Regular.woff2
deleted file mode 100644
index 483e7b66..00000000
Binary files a/asset/fonts/KaTeX_Size1-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size2-Regular.ttf b/asset/fonts/KaTeX_Size2-Regular.ttf
deleted file mode 100644
index cf326236..00000000
Binary files a/asset/fonts/KaTeX_Size2-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size2-Regular.woff b/asset/fonts/KaTeX_Size2-Regular.woff
deleted file mode 100644
index 14f6485a..00000000
Binary files a/asset/fonts/KaTeX_Size2-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size2-Regular.woff2 b/asset/fonts/KaTeX_Size2-Regular.woff2
deleted file mode 100644
index 5ff70606..00000000
Binary files a/asset/fonts/KaTeX_Size2-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size3-Regular.ttf b/asset/fonts/KaTeX_Size3-Regular.ttf
deleted file mode 100644
index ff7e2b90..00000000
Binary files a/asset/fonts/KaTeX_Size3-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size3-Regular.woff b/asset/fonts/KaTeX_Size3-Regular.woff
deleted file mode 100644
index d3626cef..00000000
Binary files a/asset/fonts/KaTeX_Size3-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size3-Regular.woff2 b/asset/fonts/KaTeX_Size3-Regular.woff2
deleted file mode 100644
index e45ca49d..00000000
Binary files a/asset/fonts/KaTeX_Size3-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size4-Regular.ttf b/asset/fonts/KaTeX_Size4-Regular.ttf
deleted file mode 100644
index 3034091c..00000000
Binary files a/asset/fonts/KaTeX_Size4-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size4-Regular.woff b/asset/fonts/KaTeX_Size4-Regular.woff
deleted file mode 100644
index 93c57a6f..00000000
Binary files a/asset/fonts/KaTeX_Size4-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Size4-Regular.woff2 b/asset/fonts/KaTeX_Size4-Regular.woff2
deleted file mode 100644
index 53b65afc..00000000
Binary files a/asset/fonts/KaTeX_Size4-Regular.woff2 and /dev/null differ
diff --git a/asset/fonts/KaTeX_Typewriter-Regular.ttf b/asset/fonts/KaTeX_Typewriter-Regular.ttf
deleted file mode 100644
index 2fd85294..00000000
Binary files a/asset/fonts/KaTeX_Typewriter-Regular.ttf and /dev/null differ
diff --git a/asset/fonts/KaTeX_Typewriter-Regular.woff b/asset/fonts/KaTeX_Typewriter-Regular.woff
deleted file mode 100644
index e90fa2bc..00000000
Binary files a/asset/fonts/KaTeX_Typewriter-Regular.woff and /dev/null differ
diff --git a/asset/fonts/KaTeX_Typewriter-Regular.woff2 b/asset/fonts/KaTeX_Typewriter-Regular.woff2
deleted file mode 100644
index e40ab151..00000000
Binary files a/asset/fonts/KaTeX_Typewriter-Regular.woff2 and /dev/null differ
diff --git a/asset/katex.min.css b/asset/katex.min.css
deleted file mode 100644
index 98b7c7bd..00000000
--- a/asset/katex.min.css
+++ /dev/null
@@ -1 +0,0 @@
-@font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype");font-weight:700;font-style:italic}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype");font-weight:700;font-style:italic}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype");font-weight:400;font-style:normal}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto;border-color:currentColor}.katex *{-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.12.0"}.katex .katex-mathml{position:absolute;clip:rect(1px,1px,1px,1px);padding:0;border:0;height:1px;width:1px;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-weight:700;font-style:italic}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{display:inline-table;table-layout:fixed;border-collapse:collapse}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;vertical-align:bottom;position:relative}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;vertical-align:bottom;font-size:1px;width:2px;min-width:2px}.katex .vbox{-ms-flex-direction:column;flex-direction:column;align-items:baseline}.katex .hbox,.katex .vbox{display:-ms-inline-flexbox;display:inline-flex}.katex .hbox{-ms-flex-direction:row;flex-direction:row;width:100%}.katex .thinbox{display:inline-flex;flex-direction:row;width:0;max-width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{display:inline-block;width:100%;border-bottom-style:solid}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{display:inline-block;border:0 solid;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{display:inline-block;width:100%;border-bottom-style:solid}.katex .hdashline{display:inline-block;width:100%;border-bottom-style:dashed}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .op-limits>.vlist-t{text-align:center}.katex .accent>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{display:block;position:absolute;width:100%;height:inherit;fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex svg path{stroke:none}.katex img{border-style:none;min-width:0;min-height:0;max-width:none;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{position:absolute;left:0;width:50.2%;overflow:hidden}.katex .halfarrow-right{position:absolute;right:0;width:50.2%;overflow:hidden}.katex .brace-left{position:absolute;left:0;width:25.1%;overflow:hidden}.katex .brace-center{position:absolute;left:25%;width:50%;overflow:hidden}.katex .brace-right{position:absolute;right:0;width:25.1%;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}
diff --git a/asset/left.svg b/asset/left.svg
deleted file mode 100644
index 5f3e9a07..00000000
--- a/asset/left.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
\ No newline at end of file
diff --git a/asset/moon.svg b/asset/moon.svg
deleted file mode 100644
index bc0bf105..00000000
--- a/asset/moon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/asset/prism-c.min.js b/asset/prism-c.min.js
deleted file mode 100644
index 6a4fff5e..00000000
--- a/asset/prism-c.min.js
+++ /dev/null
@@ -1 +0,0 @@
-Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+/,lookbehind:!0},keyword:/\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,function:/[a-z_]\w*(?=\s*\()/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],comment:Prism.languages.c.comment,directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c.boolean;
\ No newline at end of file
diff --git a/asset/prism-cpp.min.js b/asset/prism-cpp.min.js
deleted file mode 100644
index 129cbbb8..00000000
--- a/asset/prism-cpp.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp("(\\b(?:class|concept|enum|struct|typename)\\s+)(?!)\\w+".replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i,greedy:!0},operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),e.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)(?:[^;{}"'])+?(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","operator",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism);
\ No newline at end of file
diff --git a/asset/prism-csharp.min.js b/asset/prism-csharp.min.js
deleted file mode 100644
index 4b3dc42e..00000000
--- a/asset/prism-csharp.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(s){function a(e,s){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+s[+n]+")"})}function t(e,n,s){return RegExp(a(e,n),s||"")}function e(e,n){for(var s=0;s>/g,function(){return"(?:"+e+")"});return e.replace(/<>/g,"[^\\s\\S]")}var n="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",r="class enum interface struct",i="add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where where",o="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var d=l(r),p=RegExp(l(n+" "+r+" "+i+" "+o)),c=l(r+" "+i+" "+o),u=l(n+" "+r+" "+o),g=e("<(?:[^<>;=+\\-*/%&|^]|<>)*>",2),b=e("\\((?:[^()]|<>)*\\)",2),h="@?\\b[A-Za-z_]\\w*\\b",f=a("<<0>>(?:\\s*<<1>>)?",[h,g]),m=a("(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*",[c,f]),k="\\[\\s*(?:,\\s*)*\\]",y=a("<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?",[m,k]),w=a("(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?",[a("\\(<<0>>+(?:,<<0>>+)+\\)",[a("[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>",[g,b,k])]),m,k]),v={keyword:p,punctuation:/[<>()?,.:[\]]/},x="'(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'",$='"(?:\\\\.|[^\\\\"\r\n])*"';s.languages.csharp=s.languages.extend("clike",{string:[{pattern:t("(^|[^$\\\\])<<0>>",['@"(?:""|\\\\[^]|[^\\\\"])*"(?!")']),lookbehind:!0,greedy:!0},{pattern:t("(^|[^@$\\\\])<<0>>",[$]),lookbehind:!0,greedy:!0},{pattern:RegExp(x),greedy:!0,alias:"character"}],"class-name":[{pattern:t("(\\busing\\s+static\\s+)<<0>>(?=\\s*;)",[m]),lookbehind:!0,inside:v},{pattern:t("(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)",[h,w]),lookbehind:!0,inside:v},{pattern:t("(\\busing\\s+)<<0>>(?=\\s*=)",[h]),lookbehind:!0},{pattern:t("(\\b<<0>>\\s+)<<1>>",[d,f]),lookbehind:!0,inside:v},{pattern:t("(\\bcatch\\s*\\(\\s*)<<0>>",[m]),lookbehind:!0,inside:v},{pattern:t("(\\bwhere\\s+)<<0>>",[h]),lookbehind:!0},{pattern:t("(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>",[y]),lookbehind:!0,inside:v},{pattern:t("\\b<<0>>(?=\\s+(?!<<1>>)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))",[w,u,h]),inside:v}],keyword:p,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),s.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),s.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:t("([(,]\\s*)<<0>>(?=\\s*:)",[h]),lookbehind:!0,alias:"punctuation"}}),s.languages.insertBefore("csharp","class-name",{namespace:{pattern:t("(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])",[h]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:t("(\\b(?:default|typeof|sizeof)\\s*\\(\\s*)(?:[^()\\s]|\\s(?!\\s*\\))|<<0>>)*(?=\\s*\\))",[b]),lookbehind:!0,alias:"class-name",inside:v},"return-type":{pattern:t("<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))",[w,m]),inside:v,alias:"class-name"},"constructor-invocation":{pattern:t("(\\bnew\\s+)<<0>>(?=\\s*[[({])",[w]),lookbehind:!0,inside:v,alias:"class-name"},"generic-method":{pattern:t("<<0>>\\s*<<1>>(?=\\s*\\()",[h,g]),inside:{function:t("^<<0>>",[h]),generic:{pattern:RegExp(g),alias:"class-name",inside:v}}},"type-list":{pattern:t("\\b((?:<<0>>\\s+<<1>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>)(?:\\s*,\\s*(?:<<3>>|<<4>>))*(?=\\s*(?:where|[{;]|=>|$))",[d,f,h,w,p.source]),lookbehind:!0,inside:{keyword:p,"class-name":{pattern:RegExp(w),greedy:!0,inside:v},punctuation:/,/}},preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var _=$+"|"+x,B=a("/(?![*/])|//[^\r\n]*[\r\n]|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>",[_]),E=e(a("[^\"'/()]|<<0>>|\\(<>*\\)",[B]),2),R="\\b(?:assembly|event|field|method|module|param|property|return|type)\\b",P=a("<<0>>(?:\\s*\\(<<1>>*\\))?",[m,E]);s.languages.insertBefore("csharp","class-name",{attribute:{pattern:t("((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])",[R,P]),lookbehind:!0,greedy:!0,inside:{target:{pattern:t("^<<0>>(?=\\s*:)",[R]),alias:"keyword"},"attribute-arguments":{pattern:t("\\(<<0>>*\\)",[E]),inside:s.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var z=":[^}\r\n]+",S=e(a("[^\"'/()]|<<0>>|\\(<>*\\)",[B]),2),j=a("\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}",[S,z]),A=e(a("[^\"'/()]|/(?!\\*)|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>|\\(<>*\\)",[_]),2),F=a("\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}",[A,z]);function U(e,n){return{interpolation:{pattern:t("((?:^|[^{])(?:\\{\\{)*)<<0>>",[e]),lookbehind:!0,inside:{"format-string":{pattern:t("(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)",[n,z]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:s.languages.csharp}}},string:/[\s\S]+/}}s.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:t('(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[^]|\\{\\{|<<0>>|[^\\\\{"])*"',[j]),lookbehind:!0,greedy:!0,inside:U(j,S)},{pattern:t('(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"',[F]),lookbehind:!0,greedy:!0,inside:U(F,A)}]})}(Prism),Prism.languages.dotnet=Prism.languages.cs=Prism.languages.csharp;
\ No newline at end of file
diff --git a/asset/prism-darcula.css b/asset/prism-darcula.css
deleted file mode 100644
index 11a8f3ed..00000000
--- a/asset/prism-darcula.css
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * Darcula theme
- *
- * Adapted from a theme based on:
- * IntelliJ Darcula Theme (https://github.com/bulenkov/Darcula)
- *
- * @author Alexandre Paradis
- * @version 1.0
- */
-
-code[class*="lang-"],
-pre[data-lang] {
- color: #a9b7c6 !important;
- background-color: #2b2b2b !important;
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- line-height: 1.5;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-pre[data-lang]::-moz-selection, pre[data-lang] ::-moz-selection,
-code[class*="lang-"]::-moz-selection, code[class*="lang-"] ::-moz-selection {
- color: inherit;
- background: rgba(33, 66, 131, .85);
-}
-
-pre[data-lang]::selection, pre[data-lang] ::selection,
-code[class*="lang-"]::selection, code[class*="lang-"] ::selection {
- color: inherit;
- background: rgba(33, 66, 131, .85);
-}
-
-/* Code blocks */
-pre[data-lang] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
-}
-
-:not(pre) > code[class*="lang-"],
-pre[data-lang] {
- background: #2b2b2b;
-}
-
-/* Inline code */
-:not(pre) > code[class*="lang-"] {
- padding: .1em;
- border-radius: .3em;
-}
-
-.token.comment,
-.token.prolog,
-.token.cdata {
- color: #808080;
-}
-
-.token.delimiter,
-.token.boolean,
-.token.keyword,
-.token.selector,
-.token.important,
-.token.atrule {
- color: #cc7832;
-}
-
-.token.operator,
-.token.punctuation,
-.token.attr-name {
- color: #a9b7c6;
-}
-
-.token.tag,
-.token.tag .punctuation,
-.token.doctype,
-.token.builtin {
- color: #e8bf6a;
-}
-
-.token.entity,
-.token.number,
-.token.symbol {
- color: #6897bb;
-}
-
-.token.property,
-.token.constant,
-.token.variable {
- color: #9876aa;
-}
-
-.token.string,
-.token.char {
- color: #6a8759;
-}
-
-.token.attr-value,
-.token.attr-value .punctuation {
- color: #a5c261;
-}
-
-.token.attr-value .punctuation:first-child {
- color: #a9b7c6;
-}
-
-.token.url {
- color: #287bde;
- text-decoration: underline;
-}
-
-.token.function {
- color: #ffc66d;
-}
-
-.token.regex {
- background: #364135;
-}
-
-.token.bold {
- font-weight: bold;
-}
-
-.token.italic {
- font-style: italic;
-}
-
-.token.inserted {
- background: #294436;
-}
-
-.token.deleted {
- background: #484a4a;
-}
-
-code.lang-css .token.property,
-code.lang-css .token.property + .token.punctuation {
- color: #a9b7c6;
-}
-
-code.lang-css .token.id {
- color: #ffc66d;
-}
-
-code.lang-css .token.selector > .token.class,
-code.lang-css .token.selector > .token.attribute,
-code.lang-css .token.selector > .token.pseudo-class,
-code.lang-css .token.selector > .token.pseudo-element {
- color: #ffc66d;
-}
\ No newline at end of file
diff --git a/asset/prism-java.min.js b/asset/prism-java.min.js
deleted file mode 100644
index 818fd8ec..00000000
--- a/asset/prism-java.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|record|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,a=/\b[A-Z](?:\w*[a-z]\w*)?\b/;e.languages.java=e.languages.extend("clike",{"class-name":[a,/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/],keyword:t,function:[e.languages.clike.function,{pattern:/(\:\:)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),e.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},namespace:{pattern:RegExp("(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?".replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":a,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}(Prism);
\ No newline at end of file
diff --git a/asset/prism-javascript.min.js b/asset/prism-javascript.min.js
deleted file mode 100644
index 0faf69af..00000000
--- a/asset/prism-javascript.min.js
+++ /dev/null
@@ -1 +0,0 @@
-Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript;
\ No newline at end of file
diff --git a/asset/prism-php.min.js b/asset/prism-php.min.js
deleted file mode 100644
index 1c4ef765..00000000
--- a/asset/prism-php.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(n){n.languages.php=n.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,boolean:{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),n.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),n.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),n.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),n.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var e={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/,lookbehind:!0,inside:n.languages.php};n.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:e}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:e}}}),delete n.languages.php.string,n.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){n.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism);
\ No newline at end of file
diff --git a/asset/prism-python.min.js b/asset/prism-python.min.js
deleted file mode 100644
index 3045bfb1..00000000
--- a/asset/prism-python.min.js
+++ /dev/null
@@ -1 +0,0 @@
-Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python;
\ No newline at end of file
diff --git a/asset/right.svg b/asset/right.svg
deleted file mode 100644
index 7e4d26e3..00000000
--- a/asset/right.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
\ No newline at end of file
diff --git a/asset/search.min.js b/asset/search.min.js
deleted file mode 100644
index f7447441..00000000
--- a/asset/search.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){var h={},f={EXPIRE_KEY:"docsify.search.expires",INDEX_KEY:"docsify.search.index"};function l(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(e).replace(/[&<>"']/g,function(e){return n[e]})}function p(e){return e.text||"table"!==e.type||(e.cells.unshift(e.header),e.text=e.cells.map(function(e){return e.join(" | ")}).join(" |\n ")),e.text}function u(r,e,i,o){void 0===e&&(e="");var s,n=window.marked.lexer(e),c=window.Docsify.slugify,d={};return n.forEach(function(e){if("heading"===e.type&&e.depth<=o){var n=function(e){void 0===e&&(e="");var a={};return{str:e=e&&e.replace(/^'/,"").replace(/'$/,"").replace(/(?:^|\s):([\w-]+:?)=?([\w-%]+)?/g,function(e,n,t){return-1===n.indexOf(":")?(a[n]=t&&t.replace(/"/g,"")||!0,""):e}).trim(),config:a}}(e.text),t=n.str,a=n.config;s=a.id?i.toURL(r,{id:c(a.id)}):i.toURL(r,{id:c(l(e.text))}),d[s]={slug:s,title:t,body:""}}else{if(!s)return;d[s]?d[s].body?(e.text=p(e),d[s].body+="\n"+(e.text||"")):(e.text=p(e),d[s].body=d[s].body?d[s].body+e.text:e.text):d[s]={slug:s,title:"",body:""}}}),c.clear(),d}function c(e){var r=[],i=[];Object.keys(h).forEach(function(n){i=i.concat(Object.keys(h[n]).map(function(e){return h[n][e]}))});var o=(e=e.trim()).split(/[\s\-,\\/]+/);1!==o.length&&(o=[].concat(e,o));function n(e){var n=i[e],s=0,c="",d=n.title&&n.title.trim(),p=n.body&&n.body.trim(),t=n.slug||"";if(d&&(o.forEach(function(e){var n,t=new RegExp(e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"),"gi"),a=-1;if(n=d?d.search(t):-1,a=p?p.search(t):-1,0<=n||0<=a){s+=0<=n?3:0<=a?2:0,a<0&&(a=0);var r,i=0;i=0==(r=a<11?0:a-10)?70:a+e.length+60,p&&i>p.length&&(i=p.length);var o="..."+l(p).substring(r,i).replace(t,function(e){return''+e+""})+"...";c+=o}}),0\n\n'+e.title+"
\n"+e.content+"
\n\n"}),t.classList.add("show"),a.classList.add("show"),t.innerHTML=s||''+m+"
",d.hideOtherSidebarContent&&(r.classList.add("hide"),i.classList.add("hide"))}function a(e){d=e}function o(e,n){var t=n.router.parse().query.s;a(e),Docsify.dom.style("\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .input-wrap {\n display: flex;\n align-items: center;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 0 7px;\n line-height: 36px;\n font-size: 14px;\n border: 1px solid transparent;\n}\n\n.search input:focus {\n box-shadow: 0 0 5px var(--theme-color, #42b983);\n border: 1px solid var(--theme-color, #42b983);\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button,\n.search input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.search .clear-button {\n cursor: pointer;\n width: 36px;\n text-align: right;\n display: none;\n}\n\n.search .clear-button.show {\n display: block;\n}\n\n.search .clear-button svg {\n transform: scale(.5);\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}\n\n.app-name.hide, .sidebar-nav.hide {\n display: none;\n}"),function(e){void 0===e&&(e="");var n='\n \n ',t=Docsify.dom.create("div",n),a=Docsify.dom.find("aside");Docsify.dom.toggleClass(t,"search"),Docsify.dom.before(a,t)}(t),function(){var e,n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,"input"),a=Docsify.dom.find(n,".input-wrap");Docsify.dom.on(n,"click",function(e){return-1===["A","H2","P","EM"].indexOf(e.target.tagName)&&e.stopPropagation()}),Docsify.dom.on(t,"input",function(n){clearTimeout(e),e=setTimeout(function(e){return r(n.target.value.trim())},100)}),Docsify.dom.on(a,"click",function(e){"INPUT"!==e.target.tagName&&(t.value="",r())})}(),t&&setTimeout(function(e){return r(t)},500)}function s(e,n){a(e),function(e,n){var t=Docsify.dom.getNode('.search input[type="search"]');if(t)if("string"==typeof e)t.placeholder=e;else{var a=Object.keys(e).filter(function(e){return-11?(this.svnMod=n[0],this.name=n[1]):this.name=t}this.svnMod||(this.svnMod=this.path.split("/js/")[0].substr(1)),this.type="js",this.getKey=function(){return this.svnMod+":"+this.name},this._info={}}function o(e,t){var n=t=="css",r=document.createElement(n?"link":"script");return r}function u(t,n,r,i){function c(){c.isCalled||(c.isCalled=!0,clearTimeout(l),r&&r())}var s=o(t,n);s.nodeName==="SCRIPT"?a(s,c):f(s,c);var l=setTimeout(function(){throw new Error("load "+n+" timeout : "+t)},e._loadScriptTimeout||1e4),h=document.getElementsByTagName("head")[0];n=="css"?(s.rel="stylesheet",s.href=t,h.appendChild(s)):(s.type="text/javascript",s.src=t,h.insertBefore(s,h.firstChild))}function a(e,t){e.onload=e.onerror=e.onreadystatechange=function(){if(/loaded|complete|undefined/.test(e.readyState)){e.onload=e.onerror=e.onreadystatechange=null;if(e.parentNode){e.parentNode.removeChild(e);try{if(e.clearAttributes)e.clearAttributes();else for(var n in e)delete e[n]}catch(r){}}e=undefined,t&&t()}}}function f(e,t){e.attachEvent?e.attachEvent("onload",t):setTimeout(function(){l(e,t)},0)}function l(e,t){if(t&&t.isCalled)return;var n,r=navigator.userAgent,i=~r.indexOf("AppleWebKit"),s=~r.indexOf("Opera");if(i||s)e.sheet&&(n=!0);else if(e.sheet)try{e.sheet.cssRules&&(n=!0)}catch(o){if(o.name==="SecurityError"||o.name==="NS_ERROR_DOM_SECURITY_ERR")n=!0}setTimeout(function(){n?t&&t():l(e,t)},1)}var n="api";e.each=r,i.currentPath="",i.loadedPaths={},i.loadingPaths={},i.cache={},i.paths={},i.handlers=[],i.moduleFileMap={},i.requiredPaths={},i.lazyLoadPaths={},i.services={},i.isPathsLoaded=function(e){var t=!0;return r(e,function(e){if(!(e in i.loadedPaths))return t=!1}),t},i.require=function(e,t){e.search(":")<0&&(t||(t=n,i.currentPath&&(t=i.currentPath.split("/js/")[0].substr(1))),e=t+":"+e);var r=i.get(e,i.currentPath);if(r.type=="css")return;if(r){if(!r._inited){r._inited=!0;var s,o=r.svnMod;if(s=r.fn.call(null,function(e){return i.require(e,o)},r.exports,new h(r.name,o)))r.exports=s}return r.exports}throw new Error('Module "'+e+'" not found!')},i.baseUrl=t?t[t.length-1]=="/"?t:t+"/":"/",i.getBasePath=function(e){var t,n;return(n=e.indexOf("/"))!==-1&&(t=e.slice(0,n)),t&&t in i.paths?i.paths[t]:i.baseUrl},i.getJsPath=function(t,r){if(t.charAt(0)==="."){r=r.replace(/\/[^\/]+\/[^\/]+$/,""),t.search("./")===0&&(t=t.substr(2));var s=0;t=t.replace(/^(\.\.\/)+/g,function(e){return s=e.length/3,""});while(s>0)r=r.substr(0,r.lastIndexOf("/")),s--;return r+"/"+t+"/"+t.substr(t.lastIndexOf("/")+1)+".js"}var o,u,a,f,l,c;if(t.search(":")>=0){var h=t.split(":");o=h[0],t=h[1]}else r&&(o=r.split("/")[1]);o=o||n;var p=/\.css(?:\?|$)/i.test(t);p&&e._useConfig&&i.moduleFileMap[o][t]&&(t=i.moduleFileMap[o][t]);var t=l=t,d=i.getBasePath(t);return(a=t.indexOf("/"))!==-1&&(u=t.slice(0,a),f=t.lastIndexOf("/"),l=t.slice(f+1)),u&&u in i.paths&&(t=t.slice(a+1)),c=d+o+"/js/"+t+".js",c},i.get=function(e,t){var n=i.getJsPath(e,t);return i.cache[n]?i.cache[n]:new i(n,e)},i.prototype={load:function(){i.loadingPaths[this.path]=!0;var t=this.svnMod||n,r=window._bd_share_main.jscfg.domain.staticUrl+"static/"+t+"/",o=this,u=/\.css(?:\?|$)/i.test(this.name);this.type=u?"css":"js";var a="/"+this.type+"/"+i.moduleFileMap[t][this.name];e._useConfig&&i.moduleFileMap[t][this.name]?r+=this.type+"/"+i.moduleFileMap[t][this.name]:r+=this.type+"/"+this.name+(u?"":".js");if(e._firstScreenCSS.indexOf(this.name)>0||e._useConfig&&a==e._firstScreenJS)o._loaded=!0,o.ready();else{var f=(new Date).getTime();s.create({src:r,type:this.type,loaded:function(){o._info.loadedTime=(new Date).getTime()-f,o.type=="css"&&(o._loaded=!0,o.ready())}})}},lazyLoad:function(){var e=this.name;if(i.lazyLoadPaths[this.getKey()])this.define(),delete i.lazyLoadPaths[this.getKey()];else{if(this.exist())return;i.requiredPaths[this.getKey()]=!0,this.load()}},ready:function(e,t){var n=t?this._requiredStack:this._readyStack;if(e)this._loaded?e():n.push(e);else{i.loadedPaths[this.path]=!0,delete i.loadingPaths[this.path],this._loaded=!0,i.currentPath=this.path;if(this._readyStack&&this._readyStack.length>0){this._inited=!0;var s,o=this.svnMod;this.fn&&(s=this.fn.call(null,function(e){return i.require(e,o)},this.exports,new h(this.name,o)))&&(this.exports=s),r(this._readyStack,function(e){e()}),delete this._readyStack}this._requiredStack&&this._requiredStack.length>0&&(r(this._requiredStack,function(e){e()}),delete this._requiredStack)}},define:function(){var e=this,t=this.deps,n=this.path,s=[];t||(t=this.getDependents()),t.length?(r(t,function(t){s.push(i.getJsPath(t,e.path))}),r(t,function(t){var n=i.get(t,e.path);n.ready(function(){i.isPathsLoaded(s)&&e.ready()},!0),n.lazyLoad()})):this.ready()},exist:function(){var e=this.path;return e in i.loadedPaths||e in i.loadingPaths},getDependents:function(){var e=this,t=this.fn.toString(),n=t.match(/function\s*\(([^,]*),/i),i=new RegExp("[^.]\\b"+n[1]+"\\(\\s*('|\")([^()\"']*)('|\")\\s*\\)","g"),s=t.match(i),o=[];return s&&r(s,function(e,t){o[t]=e.substr(n[1].length+3).slice(0,-2)}),o}};var s={create:function(e){var t=e.src;if(t in this._paths)return;this._paths[t]=!0,r(this._rules,function(e){t=e.call(null,t)}),u(t,e.type,e.loaded)},_paths:{},_rules:[],addPathRule:function(e){this._rules.push(e)}};e.version="1.0",e.use=function(e,t){typeof e=="string"&&(e=[e]);var n=[],s=[];r(e,function(e,t){s[t]=!1}),r(e,function(e,o){var u=i.get(e),a=u._loaded;u.ready(function(){var e=u.exports||{};e._INFO=u._info,e._INFO&&(e._INFO.isNew=!a),n[o]=e,s[o]=!0;var i=!0;r(s,function(e){if(e===!1)return i=!1}),t&&i&&t.apply(null,n)}),u.lazyLoad()})},e.module=function(e,t,n){var r=i.get(e);r.fn=t,r.deps=n,i.requiredPaths[r.getKey()]?r.define():i.lazyLoadPaths[r.getKey()]=!0},e.pathRule=function(e){s.addPathRule(e)},e._addPath=function(e,t){t.slice(-1)!=="/"&&(t+="/");if(e in i.paths)throw new Error(e+" has already in Module.paths");i.paths[e]=t};var c=n;e._setMod=function(e){c=e||n},e._fileMap=function(t,n){if(typeof t=="object")r(t,function(t,n){e._fileMap(n,t)});else{var s=c;typeof n=="string"&&(n=[n]),t=t.indexOf("js/")==1?t.substr(4):t,t=t.indexOf("css/")==1?t.substr(5):t;var o=i.moduleFileMap[s];o||(o={}),r(n,function(e){o[e]||(o[e]=t)}),i.moduleFileMap[s]=o}},e._eventMap={},e.call=function(t,n,r){var i=[];for(var s=2,o=arguments.length;s=0;r--)t[r]=this.svnMod+":"+t[r];e.use(t,n)}},e._Context=h,e.addLog=function(t,n){e.use("lib/log",function(e){e.defaultLog(t,n)})},e.fire=function(t,n,r){e.use("lib/mod_evt",function(e){e.fire(t,n,r)})},e._defService=function(e,t){if(e){var n=i.services[e];n=n||{},r(t,function(e,t){n[t]=e}),i.services[e]=n}},e.getService=function(t,n,r){var s=i.services[t];if(!s)throw new Error(t+" mod didn't define any services");var o=s[n];if(!o)throw new Error(t+" mod didn't provide service "+n);e.use(t+":"+o,r)},e}({})),!window._bd_share_is_recently_loaded&&window._bd_share_main.F.module("base/min_tangram",function(e,t){var n={};n.each=function(e,t,n){var r,i,s,o=e.length;if("function"==typeof t)for(s=0;s0?t.each(e[o],function(s,u){e[o][s]=t.extend({},r[o],n,u,i[o])}):e[o]=t.extend({},r[o],n,e[o],i[o]))}),e}var t=e.T;_bd_share_main.init=function(e){e=e||window._bd_share_config||{share:{}};if(e){var t=i(e);t.like&&r(["share/like_api","view/like_view"],t.like),t.share&&r(["share/share_api","view/share_view"],t.share),t.slide&&r(["share/slide_api","view/slide_view"],t.slide),t.selectShare&&r(["share/select_api","view/select_view"],t.selectShare),t.image&&r(["share/image_api","view/image_view"],t.image)}},window._bd_share_main._LogPoolV2=[],window._bd_share_main.n1=(new Date).getTime(),t.domready(function(){window._bd_share_main.n2=(new Date).getTime()+1e3,_bd_share_main.init(),setTimeout(function(){window._bd_share_main.F.use("trans/logger",function(e){e.nsClick(),e.back(),e.duration()})},3e3)})}),!window._bd_share_is_recently_loaded&&window._bd_share_main.F.module("component/comm_tools",function(e,t){var n=function(){var e=window.location||document.location||{};return e.href||""},r=function(e,t){var n=e.length,r="";for(var i=1;i<=t;i++){var s=Math.floor(n*Math.random());r+=e.charAt(s)}return r},i=function(){var e=(+(new Date)).toString(36),t=r("0123456789abcdefghijklmnopqrstuvwxyz",3);return e+t};t.getLinkId=i,t.getPageUrl=n}),!window._bd_share_is_recently_loaded&&window._bd_share_main.F.module("trans/trans",function(e,t){var n=e("component/comm_tools"),r=e("conf/const").URLS,i=function(){window._bd_share_main.F.use("base/tangram",function(e){var t=e.T;t.cookie.get("bdshare_firstime")==null&&t.cookie.set("bdshare_firstime",new Date*1,{path:"/",expires:(new Date).setFullYear(2022)-new Date})})},s=function(e){var t=e.bdUrl||n.getPageUrl();return t=t.replace(/\'/g,"%27").replace(/\"/g,"%22"),t},o=function(e){var t=(new Date).getTime()+3e3,r={click:1,url:s(e),uid:e.bdUid||"0",to:e.__cmd,type:"text",pic:e.bdPic||"",title:(e.bdText||document.title).substr(0,300),key:(e.bdSnsKey||{})[e.__cmd]||"",desc:e.bdDesc||"",comment:e.bdComment||"",relateUid:e.bdWbuid||"",searchPic:e.bdSearchPic||0,sign:e.bdSign||"on",l:window._bd_share_main.n1.toString(32)+window._bd_share_main.n2.toString(32)+t.toString(32),linkid:n.getLinkId(),firstime:a("bdshare_firstime")||""};switch(e.__cmd){case"copy":l(r);break;case"print":c();break;case"bdxc":h();break;case"bdysc":p(r);break;case"weixin":d(r);break;default:u(e,r)}window._bd_share_main.F.use("trans/logger",function(t){t.commit(e,r)})},u=function(e,t){var n=r.jumpUrl;e.__cmd=="mshare"?n=r.mshareUrl:e.__cmd=="mail"&&(n=r.emailUrl);var i=n+"?"+f(t);window.open(i)},a=function(e){if(e){var t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),n=t.exec(document.cookie);if(n)return decodeURIComponent(n[2]||null)}},f=function(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&").replace(/%20/g,"+")},l=function(e){window._bd_share_main.F.use("base/tangram",function(t){var r=t.T;r.browser.ie?(window.clipboardData.setData("text",document.title+" "+(e.bdUrl||n.getPageUrl())),alert("\u6807\u9898\u548c\u94fe\u63a5\u590d\u5236\u6210\u529f\uff0c\u60a8\u53ef\u4ee5\u63a8\u8350\u7ed9QQ/MSN\u4e0a\u7684\u597d\u53cb\u4e86\uff01")):window.prompt("\u60a8\u4f7f\u7528\u7684\u662f\u975eIE\u6838\u5fc3\u6d4f\u89c8\u5668\uff0c\u8bf7\u6309\u4e0b Ctrl+C \u590d\u5236\u4ee3\u7801\u5230\u526a\u8d34\u677f",document.title+" "+(e.bdUrl||n.getPageUrl()))})},c=function(){window.print()},h=function(){window._bd_share_main.F.use("trans/trans_bdxc",function(e){e&&e.run()})},p=function(e){window._bd_share_main.F.use("trans/trans_bdysc",function(t){t&&t.run(e)})},d=function(e){window._bd_share_main.F.use("trans/trans_weixin",function(t){t&&t.run(e)})},v=function(e){o(e)};t.run=v,i()});
diff --git a/asset/share.svg b/asset/share.svg
deleted file mode 100644
index 79da99c4..00000000
--- a/asset/share.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
\ No newline at end of file
diff --git a/asset/sidebar.min.css b/asset/sidebar.min.css
deleted file mode 100644
index 94996d37..00000000
--- a/asset/sidebar.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.sidebar-nav li{position:relative;margin:0;cursor:pointer}.sidebar-nav ul:not(.app-sub-sidebar)>li:not(.file)::before{content:'';display:block;position:absolute;top:11px;left:-12px;height:6px;width:6px;border-right:1px solid #505d6b;border-bottom:1px solid #505d6b;transform:rotate(-45deg);transition:transform .1s}.sidebar-nav ul:not(.app-sub-sidebar)>li.open::before{transform:rotate(45deg)}.sidebar-nav ul:not(.app-sub-sidebar)>li.collapse::before{transform:rotate(-45deg)}
\ No newline at end of file
diff --git a/asset/style.css b/asset/style.css
deleted file mode 100644
index cccc9b95..00000000
--- a/asset/style.css
+++ /dev/null
@@ -1,100 +0,0 @@
- /*隐藏头部的目录*/
- #main>ul:nth-child(1) {
- display: none;
- }
-
- #main>ul:nth-child(2) {
- display: none;
- }
-
- .markdown-section h1 {
- margin: 3rem 0 2rem 0;
- }
-
- .markdown-section h2 {
- margin: 2rem 0 1rem;
- }
-
- img,
- pre {
- border-radius: 8px;
- }
-
- .content,
- .sidebar,
- .markdown-section,
- body,
- .search input {
- background-color: rgba(243, 242, 238, 1) !important;
- }
-
- @media (min-width:600px) {
- .sidebar-toggle {
- background-color: #f3f2ee;
- }
- }
-
- .docsify-copy-code-button {
- background: #f8f8f8 !important;
- color: #7a7a7a !important;
- }
-
- body {
- /*font-family: Microsoft YaHei, Source Sans Pro, Helvetica Neue, Arial, sans-serif !important;*/
- }
-
- .markdown-section>p {
- font-size: 16px !important;
- }
-
- .markdown-section pre>code {
- font-family: Consolas, Roboto Mono, Monaco, courier, monospace !important;
- font-size: .9rem !important;
-
- }
-
- /*.anchor span {
- color: rgb(66, 185, 131);
-}*/
-
- section.cover h1 {
- margin: 0;
- }
-
- body>section>div.cover-main>ul>li>a {
- color: #42b983;
- }
-
- .markdown-section img {
- box-shadow: 7px 9px 10px #aaa !important;
- }
-
-
- pre {
- background-color: #f3f2ee !important;
- }
-
- @media (min-width:600px) {
- pre code {
- /*box-shadow: 2px 1px 20px 2px #aaa;*/
- /*border-radius: 10px !important;*/
- padding-left: 20px !important;
- }
- }
-
- @media (max-width:600px) {
- pre {
- padding-left: 0px !important;
- padding-right: 0px !important;
- }
- }
-
- .markdown-section pre {
- padding-left: 0 !important;
- padding-right: 0px !important;
- box-shadow: 2px 1px 20px 2px #aaa;
- }
-
- iframe {
- display: inline;
- }
\ No newline at end of file
diff --git a/asset/sun.svg b/asset/sun.svg
deleted file mode 100644
index 8fb9960c..00000000
--- a/asset/sun.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/asset/up.svg b/asset/up.svg
deleted file mode 100644
index ee90b8fe..00000000
--- a/asset/up.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
\ No newline at end of file
diff --git a/asset/vue.css b/asset/vue.css
deleted file mode 100644
index d9b71bb1..00000000
--- a/asset/vue.css
+++ /dev/null
@@ -1,829 +0,0 @@
-@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");
-* {
- -webkit-font-smoothing: antialiased;
- -webkit-overflow-scrolling: touch;
- -webkit-tap-highlight-color: rgba(0,0,0,0);
- -webkit-text-size-adjust: none;
- -webkit-touch-callout: none;
- box-sizing: border-box;
-}
-body:not(.ready) {
- overflow: hidden;
-}
-body:not(.ready) [data-cloak],
-body:not(.ready) .app-nav,
-body:not(.ready) > nav {
- display: none;
-}
-div#app {
- font-size: 30px;
- font-weight: lighter;
- margin: 40vh auto;
- text-align: center;
-}
-div#app:empty::before {
- content: 'Loading...';
-}
-.emoji {
- height: 1.2rem;
- vertical-align: middle;
-}
-.progress {
- background-color: var(--theme-color, #42b983);
- height: 2px;
- left: 0px;
- position: fixed;
- right: 0px;
- top: 0px;
- transition: width 0.2s, opacity 0.4s;
- width: 0%;
- z-index: 999999;
-}
-.search a:hover {
- color: var(--theme-color, #42b983);
-}
-.search .search-keyword {
- color: var(--theme-color, #42b983);
- font-style: normal;
- font-weight: bold;
-}
-html,
-body {
- height: 100%;
-}
-body {
- -moz-osx-font-smoothing: grayscale;
- -webkit-font-smoothing: antialiased;
- color: #34495e;
- font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
- font-size: 15px;
- letter-spacing: 0;
- margin: 0;
- overflow-x: hidden;
-}
-img {
- max-width: 100%;
-}
-a[disabled] {
- cursor: not-allowed;
- opacity: 0.6;
-}
-kbd {
- border: solid 1px #ccc;
- border-radius: 3px;
- display: inline-block;
- font-size: 12px !important;
- line-height: 12px;
- margin-bottom: 3px;
- padding: 3px 5px;
- vertical-align: middle;
-}
-li input[type='checkbox'] {
- margin: 0 0.2em 0.25em 0;
- vertical-align: middle;
-}
-.app-nav {
- margin: 25px 60px 0 0;
- position: absolute;
- right: 0;
- text-align: right;
- z-index: 10;
-/* navbar dropdown */
-}
-.app-nav.no-badge {
- margin-right: 25px;
-}
-.app-nav p {
- margin: 0;
-}
-.app-nav > a {
- margin: 0 1rem;
- padding: 5px 0;
-}
-.app-nav ul,
-.app-nav li {
- display: inline-block;
- list-style: none;
- margin: 0;
-}
-.app-nav a {
- color: inherit;
- font-size: 16px;
- text-decoration: none;
- transition: color 0.3s;
-}
-.app-nav a:hover {
- color: var(--theme-color, #42b983);
-}
-.app-nav a.active {
- border-bottom: 2px solid var(--theme-color, #42b983);
- color: var(--theme-color, #42b983);
-}
-.app-nav li {
- display: inline-block;
- margin: 0 1rem;
- padding: 5px 0;
- position: relative;
- cursor: pointer;
-}
-.app-nav li ul {
- background-color: #fff;
- border: 1px solid #ddd;
- border-bottom-color: #ccc;
- border-radius: 4px;
- box-sizing: border-box;
- display: none;
- max-height: calc(100vh - 61px);
- overflow-y: auto;
- padding: 10px 0;
- position: absolute;
- right: -15px;
- text-align: left;
- top: 100%;
- white-space: nowrap;
-}
-.app-nav li ul li {
- display: block;
- font-size: 14px;
- line-height: 1rem;
- margin: 0;
- margin: 8px 14px;
- white-space: nowrap;
-}
-.app-nav li ul a {
- display: block;
- font-size: inherit;
- margin: 0;
- padding: 0;
-}
-.app-nav li ul a.active {
- border-bottom: 0;
-}
-.app-nav li:hover ul {
- display: block;
-}
-.github-corner {
- border-bottom: 0;
- position: fixed;
- right: 0;
- text-decoration: none;
- top: 0;
- z-index: 1;
-}
-.github-corner:hover .octo-arm {
- -webkit-animation: octocat-wave 560ms ease-in-out;
- animation: octocat-wave 560ms ease-in-out;
-}
-.github-corner svg {
- color: #fff;
- fill: var(--theme-color, #42b983);
- height: 80px;
- width: 80px;
-}
-main {
- display: block;
- position: relative;
- width: 100vw;
- height: 100%;
- z-index: 0;
-}
-main.hidden {
- display: none;
-}
-.anchor {
- display: inline-block;
- text-decoration: none;
- transition: all 0.3s;
-}
-.anchor span {
- color: #34495e;
-}
-.anchor:hover {
- text-decoration: underline;
-}
-.sidebar {
- border-right: 1px solid rgba(0,0,0,0.07);
- overflow-y: auto;
- padding: 40px 0 0;
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- transition: transform 250ms ease-out;
- width: 300px;
- z-index: 20;
-}
-.sidebar > h1 {
- margin: 0 auto 1rem;
- font-size: 1.5rem;
- font-weight: 300;
- text-align: center;
-}
-.sidebar > h1 a {
- color: inherit;
- text-decoration: none;
-}
-.sidebar > h1 .app-nav {
- display: block;
- position: static;
-}
-.sidebar .sidebar-nav {
- line-height: 2em;
- padding-bottom: 40px;
-}
-.sidebar li.collapse .app-sub-sidebar {
- display: none;
-}
-.sidebar ul {
- margin: 0 0 0 15px;
- padding: 0;
-}
-.sidebar li > p {
- font-weight: 700;
- margin: 0;
-}
-.sidebar ul,
-.sidebar ul li {
- list-style: none;
-}
-.sidebar ul li a {
- border-bottom: none;
- display: block;
-}
-.sidebar ul li ul {
- padding-left: 20px;
-}
-.sidebar::-webkit-scrollbar {
- width: 4px;
-}
-.sidebar::-webkit-scrollbar-thumb {
- background: transparent;
- border-radius: 4px;
-}
-.sidebar:hover::-webkit-scrollbar-thumb {
- background: rgba(136,136,136,0.4);
-}
-.sidebar:hover::-webkit-scrollbar-track {
- background: rgba(136,136,136,0.1);
-}
-.sidebar-toggle {
- background-color: transparent;
- background-color: rgba(255,255,255,0.8);
- border: 0;
- outline: none;
- padding: 10px;
- position: absolute;
- bottom: 0;
- left: 0;
- text-align: center;
- transition: opacity 0.3s;
- width: 284px;
- z-index: 30;
- cursor: pointer;
-}
-.sidebar-toggle:hover .sidebar-toggle-button {
- opacity: 0.4;
-}
-.sidebar-toggle span {
- background-color: var(--theme-color, #42b983);
- display: block;
- margin-bottom: 4px;
- width: 16px;
- height: 2px;
-}
-body.sticky .sidebar,
-body.sticky .sidebar-toggle {
- position: fixed;
-}
-.content {
- padding-top: 60px;
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 300px;
- transition: left 250ms ease;
-}
-.markdown-section {
- margin: 0 auto;
- max-width: 80%;
- padding: 30px 15px 40px 15px;
- position: relative;
-}
-.markdown-section > * {
- box-sizing: border-box;
- font-size: inherit;
-}
-.markdown-section > :first-child {
- margin-top: 0 !important;
-}
-.markdown-section hr {
- border: none;
- border-bottom: 1px solid #eee;
- margin: 2em 0;
-}
-.markdown-section iframe {
- border: 1px solid #eee;
-/* fix horizontal overflow on iOS Safari */
- width: 1px;
- min-width: 100%;
-}
-.markdown-section table {
- border-collapse: collapse;
- border-spacing: 0;
- display: block;
- margin-bottom: 1rem;
- overflow: auto;
- width: 100%;
-}
-.markdown-section th {
- border: 1px solid #ddd;
- font-weight: bold;
- padding: 6px 13px;
-}
-.markdown-section td {
- border: 1px solid #ddd;
- padding: 6px 13px;
-}
-.markdown-section tr {
- border-top: 1px solid #ccc;
-}
-.markdown-section tr:nth-child(2n) {
- background-color: #f8f8f8;
-}
-.markdown-section p.tip {
- background-color: #f8f8f8;
- border-bottom-right-radius: 2px;
- border-left: 4px solid #f66;
- border-top-right-radius: 2px;
- margin: 2em 0;
- padding: 12px 24px 12px 30px;
- position: relative;
-}
-.markdown-section p.tip:before {
- background-color: #f66;
- border-radius: 100%;
- color: #fff;
- content: '!';
- font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
- font-size: 14px;
- font-weight: bold;
- left: -12px;
- line-height: 20px;
- position: absolute;
- height: 20px;
- width: 20px;
- text-align: center;
- top: 14px;
-}
-.markdown-section p.tip code {
- background-color: #efefef;
-}
-.markdown-section p.tip em {
- color: #34495e;
-}
-.markdown-section p.warn {
- background: rgba(66,185,131,0.1);
- border-radius: 2px;
- padding: 1rem;
-}
-.markdown-section ul.task-list > li {
- list-style-type: none;
-}
-body.close .sidebar {
- transform: translateX(-300px);
-}
-body.close .sidebar-toggle {
- width: auto;
-}
-body.close .content {
- left: 0;
-}
-@media print {
- .github-corner,
- .sidebar-toggle,
- .sidebar,
- .app-nav {
- display: none;
- }
-}
-@media screen and (max-width: 768px) {
- .github-corner,
- .sidebar-toggle,
- .sidebar {
- position: fixed;
- }
- .app-nav {
- margin-top: 16px;
- }
- .app-nav li ul {
- top: 30px;
- }
- main {
- height: auto;
- overflow-x: hidden;
- }
- .sidebar {
- left: -300px;
- transition: transform 250ms ease-out;
- }
- .content {
- left: 0;
- max-width: 100vw;
- position: static;
- padding-top: 20px;
- transition: transform 250ms ease;
- }
- .app-nav,
- .github-corner {
- transition: transform 250ms ease-out;
- }
- .sidebar-toggle {
- background-color: transparent;
- width: auto;
- padding: 30px 30px 10px 10px;
- }
- body.close .sidebar {
- transform: translateX(300px);
- }
- body.close .sidebar-toggle {
- background-color: rgba(255,255,255,0.8);
- transition: 1s background-color;
- width: 284px;
- padding: 10px;
- }
- body.close .content {
- transform: translateX(300px);
- }
- body.close .app-nav,
- body.close .github-corner {
- display: none;
- }
- .github-corner:hover .octo-arm {
- -webkit-animation: none;
- animation: none;
- }
- .github-corner .octo-arm {
- -webkit-animation: octocat-wave 560ms ease-in-out;
- animation: octocat-wave 560ms ease-in-out;
- }
-}
-@-webkit-keyframes octocat-wave {
- 0%, 100% {
- transform: rotate(0);
- }
- 20%, 60% {
- transform: rotate(-25deg);
- }
- 40%, 80% {
- transform: rotate(10deg);
- }
-}
-@keyframes octocat-wave {
- 0%, 100% {
- transform: rotate(0);
- }
- 20%, 60% {
- transform: rotate(-25deg);
- }
- 40%, 80% {
- transform: rotate(10deg);
- }
-}
-section.cover {
- align-items: center;
- background-position: center center;
- background-repeat: no-repeat;
- background-size: cover;
- height: 100vh;
- width: 100vw;
- display: none;
-}
-section.cover.show {
- display: flex;
-}
-section.cover.has-mask .mask {
- background-color: #fff;
- opacity: 0.8;
- position: absolute;
- top: 0;
- height: 100%;
- width: 100%;
-}
-section.cover .cover-main {
- flex: 1;
- margin: -20px 16px 0;
- text-align: center;
- position: relative;
-}
-section.cover a {
- color: inherit;
- text-decoration: none;
-}
-section.cover a:hover {
- text-decoration: none;
-}
-section.cover p {
- line-height: 1.5rem;
- margin: 1em 0;
-}
-section.cover h1 {
- color: inherit;
- font-size: 2.5rem;
- font-weight: 300;
- margin: 0.625rem 0 2.5rem;
- position: relative;
- text-align: center;
-}
-section.cover h1 a {
- display: block;
-}
-section.cover h1 small {
- bottom: -0.4375rem;
- font-size: 1rem;
- position: absolute;
-}
-section.cover blockquote {
- font-size: 1.5rem;
- text-align: center;
-}
-section.cover ul {
- line-height: 1.8;
- list-style-type: none;
- margin: 1em auto;
- max-width: 500px;
- padding: 0;
-}
-section.cover .cover-main > p:last-child a {
- border-color: var(--theme-color, #42b983);
- border-radius: 2rem;
- border-style: solid;
- border-width: 1px;
- box-sizing: border-box;
- color: var(--theme-color, #42b983);
- display: inline-block;
- font-size: 1.05rem;
- letter-spacing: 0.1rem;
- margin: 0.5rem 1rem;
- padding: 0.75em 2rem;
- text-decoration: none;
- transition: all 0.15s ease;
-}
-section.cover .cover-main > p:last-child a:last-child {
- background-color: var(--theme-color, #42b983);
- color: #fff;
-}
-section.cover .cover-main > p:last-child a:last-child:hover {
- color: inherit;
- opacity: 0.8;
-}
-section.cover .cover-main > p:last-child a:hover {
- color: inherit;
-}
-section.cover blockquote > p > a {
- border-bottom: 2px solid var(--theme-color, #42b983);
- transition: color 0.3s;
-}
-section.cover blockquote > p > a:hover {
- color: var(--theme-color, #42b983);
-}
-body {
- background-color: #fff;
-}
-/* sidebar */
-.sidebar {
- background-color: #fff;
- color: #364149;
-}
-.sidebar li {
- margin: 6px 0 6px 0;
-}
-.sidebar ul li a {
- color: #505d6b;
- font-size: 14px;
- font-weight: normal;
- overflow: hidden;
- text-decoration: none;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.sidebar ul li a:hover {
- text-decoration: underline;
-}
-.sidebar ul li ul {
- padding: 0;
-}
-.sidebar ul li.active > a {
- border-right: 2px solid;
- color: var(--theme-color, #42b983);
- font-weight: 600;
-}
-.app-sub-sidebar li::before {
- content: '-';
- padding-right: 4px;
- float: left;
-}
-/* markdown content found on pages */
-.markdown-section h1,
-.markdown-section h2,
-.markdown-section h3,
-.markdown-section h4,
-.markdown-section strong {
- color: #2c3e50;
- font-weight: 600;
-}
-.markdown-section a {
- color: var(--theme-color, #42b983);
- font-weight: 600;
-}
-.markdown-section h1 {
- font-size: 2rem;
- margin: 0 0 1rem;
-}
-.markdown-section h2 {
- font-size: 1.75rem;
- margin: 45px 0 0.8rem;
-}
-.markdown-section h3 {
- font-size: 1.5rem;
- margin: 40px 0 0.6rem;
-}
-.markdown-section h4 {
- font-size: 1.25rem;
-}
-.markdown-section h5 {
- font-size: 1rem;
-}
-.markdown-section h6 {
- color: #777;
- font-size: 1rem;
-}
-.markdown-section figure,
-.markdown-section p {
- margin: 1.2em 0;
-}
-.markdown-section p,
-.markdown-section ul,
-.markdown-section ol {
- line-height: 1.6rem;
- word-spacing: 0.05rem;
-}
-.markdown-section ul,
-.markdown-section ol {
- padding-left: 1.5rem;
-}
-.markdown-section blockquote {
- border-left: 4px solid var(--theme-color, #42b983);
- color: #858585;
- margin: 2em 0;
- padding-left: 20px;
-}
-.markdown-section blockquote p {
- font-weight: 600;
- margin-left: 0;
-}
-.markdown-section iframe {
- margin: 1em 0;
-}
-.markdown-section em {
- color: #7f8c8d;
-}
-.markdown-section code {
- background-color: #f8f8f8;
- border-radius: 2px;
- color: #e96900;
- font-family: 'Roboto Mono', Monaco, courier, monospace;
- font-size: 0.8rem;
- margin: 0 2px;
- padding: 3px 5px;
- white-space: pre-wrap;
-}
-.markdown-section pre {
- -moz-osx-font-smoothing: initial;
- -webkit-font-smoothing: initial;
- background-color: #f8f8f8;
- font-family: 'Roboto Mono', Monaco, courier, monospace;
- line-height: 1.5rem;
- margin: 1.2em 0;
- overflow: auto;
- padding: 0 1.4rem;
- position: relative;
- word-wrap: normal;
-}
-/* code highlight */
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: #8e908c;
-}
-.token.namespace {
- opacity: 0.7;
-}
-.token.boolean,
-.token.number {
- color: #c76b29;
-}
-.token.punctuation {
- color: #525252;
-}
-.token.property {
- color: #c08b30;
-}
-.token.tag {
- color: #2973b7;
-}
-.token.string {
- color: var(--theme-color, #42b983);
-}
-.token.selector {
- color: #6679cc;
-}
-.token.attr-name {
- color: #2973b7;
-}
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
- color: #22a2c9;
-}
-.token.attr-value,
-.token.control,
-.token.directive,
-.token.unit {
- color: var(--theme-color, #42b983);
-}
-.token.keyword,
-.token.function {
- color: #e96900;
-}
-.token.statement,
-.token.regex,
-.token.atrule {
- color: #22a2c9;
-}
-.token.placeholder,
-.token.variable {
- color: #3d8fd1;
-}
-.token.deleted {
- text-decoration: line-through;
-}
-.token.inserted {
- border-bottom: 1px dotted #202746;
- text-decoration: none;
-}
-.token.italic {
- font-style: italic;
-}
-.token.important,
-.token.bold {
- font-weight: bold;
-}
-.token.important {
- color: #c94922;
-}
-.token.entity {
- cursor: help;
-}
-.markdown-section pre > code {
- -moz-osx-font-smoothing: initial;
- -webkit-font-smoothing: initial;
- background-color: #f8f8f8;
- border-radius: 2px;
- color: #525252;
- display: block;
- font-family: 'Roboto Mono', Monaco, courier, monospace;
- font-size: 0.8rem;
- line-height: inherit;
- margin: 0 2px;
- max-width: inherit;
- overflow: inherit;
- padding: 2.2em 5px;
- white-space: inherit;
-}
-.markdown-section code::after,
-.markdown-section code::before {
- letter-spacing: 0.05rem;
-}
-code .token {
- -moz-osx-font-smoothing: initial;
- -webkit-font-smoothing: initial;
- min-height: 1.5rem;
- position: relative;
- left: auto;
-}
-pre::after {
- color: #ccc;
- content: attr(data-lang);
- font-size: 0.6rem;
- font-weight: 600;
- height: 15px;
- line-height: 15px;
- padding: 5px 10px 0;
- position: absolute;
- right: 0;
- text-align: right;
- top: 0;
-}
diff --git a/old/config b/config
similarity index 100%
rename from old/config
rename to config
diff --git a/docs/Algorithm/DataStructure/C++/README.md b/docs/Algorithm/DataStructure/C++/README.md
new file mode 100755
index 00000000..6889eed1
--- /dev/null
+++ b/docs/Algorithm/DataStructure/C++/README.md
@@ -0,0 +1,5 @@
+# Some algorithm templates for better understanding!
+
+> [八大排序算法 集合](/docs/Algorithm/Sort)
+
+
diff --git a/.nojekyll b/docs/Algorithm/DataStructure/Java/Cipher/README.md
old mode 100644
new mode 100755
similarity index 100%
rename from .nojekyll
rename to docs/Algorithm/DataStructure/Java/Cipher/README.md
diff --git a/img/Algorithm/LeetCode/005/1.md b/docs/Algorithm/DataStructure/Java/Compression/README.md
old mode 100644
new mode 100755
similarity index 100%
rename from img/Algorithm/LeetCode/005/1.md
rename to docs/Algorithm/DataStructure/Java/Compression/README.md
diff --git a/docs/Algorithm/DataStructure/Java/Conversion/README.md b/docs/Algorithm/DataStructure/Java/Conversion/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/Java/Data_Structure/Graph/README.md b/docs/Algorithm/DataStructure/Java/Data_Structure/Graph/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Data_Structure/Graph/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Java/Data_Structure/HashMap/README.md b/docs/Algorithm/DataStructure/Java/Data_Structure/HashMap/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Data_Structure/HashMap/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Java/Data_Structure/HashTable/README.md b/docs/Algorithm/DataStructure/Java/Data_Structure/HashTable/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Data_Structure/HashTable/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Java/Data_Structure/Heqp/README.md b/docs/Algorithm/DataStructure/Java/Data_Structure/Heqp/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Data_Structure/Heqp/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Java/Data_Structure/LinkedList/README.md b/docs/Algorithm/DataStructure/Java/Data_Structure/LinkedList/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Data_Structure/LinkedList/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Java/Data_Structure/Matrix/README.md b/docs/Algorithm/DataStructure/Java/Data_Structure/Matrix/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Data_Structure/Matrix/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Java/Data_Structure/Queue/README.md b/docs/Algorithm/DataStructure/Java/Data_Structure/Queue/README.md
new file mode 100755
index 00000000..2259b95a
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Data_Structure/Queue/README.md
@@ -0,0 +1,2 @@
+## Queue Implementation
+
diff --git a/img/Algorithm/LeetCode/011/1.md b/docs/Algorithm/DataStructure/Java/Data_Structure/README.md
old mode 100644
new mode 100755
similarity index 100%
rename from img/Algorithm/LeetCode/011/1.md
rename to docs/Algorithm/DataStructure/Java/Data_Structure/README.md
diff --git a/docs/Algorithm/DataStructure/Java/Data_Structure/Stack/README.md b/docs/Algorithm/DataStructure/Java/Data_Structure/Stack/README.md
new file mode 100755
index 00000000..a381eb91
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Data_Structure/Stack/README.md
@@ -0,0 +1,65 @@
+## Stack Implementation
+
+### Stack using Array
+
+```java
+public class Stack {
+
+ private int[] nums;
+ private int size;
+ private int top; # 栈顶位置
+
+ private Stack(int size) {
+ this.size = size;
+ this.nums = new int[size];
+ this.top = -1;
+ }
+
+ private boolean isFull() {
+ return this.top == this.size - 1;
+ }
+
+ public boolean push(int num) {
+ if(isFull()) {
+ System.out.println("the stack is full!");
+ return false;
+ } else {
+ this.top++;
+ this.nums[this.top] = num;
+ return true;
+ }
+ }
+
+ public int peek() {
+ return this.nums[this.top];
+ }
+
+ public int pop() throws Exception {
+ if(empty()) {
+ throw new Exception("the stack is empty!");
+ } else {
+ return this.nums[this.top--];
+ }
+ }
+
+ public boolean empty() {
+ return this.top == -1;
+ }
+
+ public static void main(String[] args) {
+ Stack stack = new Stack(20);
+ for (int i = 0; i < 10; i++) {
+ stack.push(i);
+ }
+ System.out.println("Now the peek num is:" + stack.peek());
+
+ while(!stack.empty()) {
+ try {
+ System.out.println(stack.pop());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
+```
diff --git a/docs/Algorithm/DataStructure/Java/Data_Structure/Tree/README.md b/docs/Algorithm/DataStructure/Java/Data_Structure/Tree/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Data_Structure/Tree/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Java/Dynamic_Programming/README.md b/docs/Algorithm/DataStructure/Java/Dynamic_Programming/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/Java/Hash/README.md b/docs/Algorithm/DataStructure/Java/Hash/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/Others/NextNodeInOrderTree.md b/docs/Algorithm/DataStructure/Java/Others/NextNodeInOrderTree.md
old mode 100644
new mode 100755
similarity index 100%
rename from docs/Algorithm/DataStructure/Others/NextNodeInOrderTree.md
rename to docs/Algorithm/DataStructure/Java/Others/NextNodeInOrderTree.md
diff --git a/docs/Algorithm/DataStructure/Others/TopKWords.java b/docs/Algorithm/DataStructure/Java/Others/TopKWords.java
old mode 100644
new mode 100755
similarity index 100%
rename from docs/Algorithm/DataStructure/Others/TopKWords.java
rename to docs/Algorithm/DataStructure/Java/Others/TopKWords.java
diff --git a/docs/Algorithm/DataStructure/Others/words.txt b/docs/Algorithm/DataStructure/Java/Others/words.txt
old mode 100644
new mode 100755
similarity index 100%
rename from docs/Algorithm/DataStructure/Others/words.txt
rename to docs/Algorithm/DataStructure/Java/Others/words.txt
diff --git a/docs/Algorithm/DataStructure/Java/README.md b/docs/Algorithm/DataStructure/Java/README.md
new file mode 100755
index 00000000..ed14f53a
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/README.md
@@ -0,0 +1,2 @@
+# Some algorithm templates for better understanding!
+
diff --git a/docs/Algorithm/DataStructure/Java/Search/README.md b/docs/Algorithm/DataStructure/Java/Search/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/Java/Sort/README.md b/docs/Algorithm/DataStructure/Java/Sort/README.md
new file mode 100755
index 00000000..7f01a8d7
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Sort/README.md
@@ -0,0 +1,13 @@
+# 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/src/py3.x/sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/src/py3.x/sort/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/src/py3.x/sort/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/src/py3.x/sort/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/src/py3.x/sort/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/src/py3.x/sort/MergeSort.py) |
+| 基数排序 |  | [RadixSort.py](/src/py3.x/sort/RadixSort.py) |
diff --git a/docs/Algorithm/DataStructure/Java/Sort/Sort.ipynb b/docs/Algorithm/DataStructure/Java/Sort/Sort.ipynb
new file mode 100755
index 00000000..a38ab891
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Sort/Sort.ipynb
@@ -0,0 +1,772 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# 排序算法\n",
+ "\n",
+ "## 1、冒泡排序(Bubble Sort)\n",
+ "\n",
+ "### 1.1、简介\n",
+ "\n",
+ "冒泡排序是一种简单的排序算法。它重复地走访过要排序的数列,一次比较两个元素,如果它们两个的顺序错误就把它们两个交换。走访数列的工作是重复的,直到最后没有再需要交换,也就是说该数列已经排序完成了。这个算法的名字由来是因为越小的元素会经由交换慢慢 \"浮\" 到数列的顶端。\n",
+ "\n",
+ "### 1.2、算法描述\n",
+ "\n",
+ " - 比较相邻的元素。如果第一个比第二个大,就交换它们两个;\n",
+ " - 对每一组相邻元素做相同的工作,从开始第一对到结尾的最后一对,这样在最后的元素应该会是最大的数;\n",
+ " - 针对所有的元素重复以上的步骤,除了最后一个;\n",
+ " - 重复步骤 1~3 ,直到排序完成。\n",
+ " \n",
+ "### 1.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 1.4、代码实现"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def bubble_sort(nums):\n",
+ " # 外层循环负责设置冒泡排序进行的次数\n",
+ " for i in range(len(nums)-1):\n",
+ " # 内层循环负责前后两两比较,求最大值放到最后\n",
+ " # j 为列表下标\n",
+ " for j in range(len(nums)-1-i):\n",
+ " # 如果相互比较的两个数,前一个数比后一个数大\n",
+ " if nums[j] > nums[j+1]:\n",
+ " nums[j], nums[j+1] = nums[j+1], nums[j]\n",
+ " return nums\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " nums = [5, 1, 9, 3, 2, 7]\n",
+ " bubble_sort(nums)\n",
+ " print(nums)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### 1.5、代码优化\n",
+ "\n",
+ "#### 1.5.1、优化 1\n",
+ "\n",
+ "如果上面代码中,里面一层循环在某次扫描中没有执行交换,则说明此时数组已经全部有序了,无需再进行扫描。因此,我们增加一个标记,每次发生交换,用来标记,如果某次循环完没有标记,则说明已经完成排序。"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 改进版的冒泡排序_1\n",
+ "def bubble_sort_2(nums):\n",
+ " # 外层循环负责设置冒泡排序进行的次数\n",
+ " for i in range(len(nums)-1):\n",
+ " # 标记是否已经完成排序\n",
+ " swaped = False\n",
+ " # 内层循环负责前后两两比较,求最大值放到最后,j 为列表下标\n",
+ " for j in range(len(nums)-1-i):\n",
+ " # 如果相互比较的两个数,前一个数比后一个数大\n",
+ " if nums[j] > nums[j+1]:\n",
+ " nums[j], nums[j+1] = nums[j+1], nums[j]\n",
+ " swaped = True\n",
+ " # 如果上一次扫描没有发生交换,说明数组已经全部都排好序了,那我们就退出循环\n",
+ " if not swaped:\n",
+ " break\n",
+ " return nums\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " nums = [5, 1, 9, 3, 2, 7]\n",
+ " bubble_sort_2(nums)\n",
+ " print(nums)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "#### 1.5.2、优化 2\n",
+ "\n",
+ "在我们第一步优化的基础上,我们可以进一步思考:如果 R[0 ~ i] 已是有序区间,上次扫描的区间是 R[i ~ n],记上次扫描时最后一次执行交换的位置为 lastSwapPos,则 lastSwapPos 在 i 与 n 之间,不难发现 R[i ~ lastSwapPos] 区间也是有序的,否则这个区间也会发生变换;所以下次扫描区间就可以由 R[i ~ n] 缩减到 R[lastSwapPos ~ n] 。"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 改进版的冒泡排序_2\n",
+ "def bubble_sort_3(nums):\n",
+ " lastSwapPos = 0\n",
+ " lastSwapPosTemp = 0\n",
+ " # 外层循环负责设置冒泡排序进行的次数\n",
+ " for i in range(len(nums)-1):\n",
+ " lastSwapPos = lastSwapPosTemp\n",
+ " # 内层循环负责前后两两比较,求最大值放到最后,j 为列表下标\n",
+ " for j in range(len(nums)-1-i):\n",
+ " # 如果相互比较的两个数,前一个数比后一个数大\n",
+ " if nums[j] > nums[j+1]:\n",
+ " nums[j], nums[j+1] = nums[j+1], nums[j]\n",
+ " # 记录最后一次发生交换的位置\n",
+ " lastSwapPosTemp = j\n",
+ " # 如果上一次扫描没有发生交换,说明数组已经全部都排好序了,那我们就退出循环\n",
+ " if lastSwapPos == lastSwapPosTemp:\n",
+ " break\n",
+ " return nums\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " nums = [5, 1, 9, 3, 2, 7]\n",
+ " bubble_sort_3(nums)\n",
+ " print(nums)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 2、插入排序(Insert Sort)\n",
+ "\n",
+ "### 2.1、简介\n",
+ "\n",
+ "插入排序(insert sort)的算法描述是一种简单直观的排序算法。它的工作原理是通过构建有序序列,对于未排序数据,在已排序序列中从后向前扫描,找到相应位置并插入。\n",
+ "\n",
+ "### 2.2、算法描述\n",
+ "\n",
+ "一般来说,插入排序都采用 in-place 在数组上实现。具体算法描述如下:\n",
+ "\n",
+ " - 从第一个元素开始,该元素可以认为已经被排序;\n",
+ " - 取出下一个元素,在已经排序的元素序列中从后向前扫描;\n",
+ " - 如果该元素(已排序)大于新元素,将该元素移到下一个位置;\n",
+ " - 重复步骤 3 ,直到找到已排序的元素小于或者等于新元素的位置;\n",
+ " - 将新元素插入到该位置后;\n",
+ " - 重复步骤 2 ~ 5\n",
+ " \n",
+ "### 2.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 2.4、代码实现\n",
+ "\n",
+ "插入排序和冒泡排序的区别在于:\n",
+ "\n",
+ " - 插入排序的前提是:左边是有序的数列\n",
+ " - 冒泡排序:相邻的值进行交换,一共进行 n 次"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[5, 1, 9, 3, 2, 7]\n",
+ "[5]\n",
+ "[1, 5]\n",
+ "[1, 5, 9]\n",
+ "[1, 3, 5, 9]\n",
+ "[1, 2, 3, 5, 9]\n",
+ "result: [1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def insert_sort(nums):\n",
+ " # 循环 除第一个数字组成的有序数组 以外的数字\n",
+ " for i in range(1, len(nums)):\n",
+ " # 每一个数字,依次和有序数组进行比较\n",
+ " print(nums[:i])\n",
+ " for j in range(len(nums[:i])):\n",
+ " if nums[i] < nums[j]:\n",
+ " nums[i], nums[j] = nums[j], nums[i]\n",
+ " \n",
+ "if __name__ == \"__main__\":\n",
+ " l = [5, 1, 9, 3, 2, 7]\n",
+ " print(l)\n",
+ " insert_sort(l)\n",
+ " print(\"result: \" + str(l))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 3、选择排序(SelectionSort)\n",
+ "\n",
+ "### 3.1、简介\n",
+ "\n",
+ "选择排序(Selection-sort)是一种简单直观的排序算法。它的工作原理:首先在未排序序列中找到最小(大)元素,存放到排序序列的起始位置,然后,再从剩余未排序元素中继续寻找最小(大)元素,然后放到已排序序列的末尾。以此类推,直到所有元素均排序完毕。 \n",
+ "\n",
+ "### 3.2、算法描述\n",
+ "\n",
+ "n 个记录的直接选择排序可经过 n-1 趟直接选择排序得到有序结果。具体算法描述如下:\n",
+ "\n",
+ " - 初始状态:无序区为 R[1 ... n],有序区为空;\n",
+ " - 第 i 趟排序 (i = 1, 2, 3, ... n-1) 开始时,当前有序区和无序区分别为 R[1 ... i-1] 和 R[i ... n]。该趟排序从当前无序区中 —— 选出关键字最小的记录 R[k],将它与无序区的第 1 个记录 R 交换,使 R[1 ... i] 和 R[i+1 ... n] 分别变为记录个数增加 1 个的新有序区和记录个数减少 1 个的新无序区;\n",
+ " - n-1 趟结束,数组有序化了。\n",
+ " \n",
+ "### 3.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 3.4、代码实现\n",
+ "\n",
+ "选择排序和冒泡排序的区别在于:\n",
+ "\n",
+ "选择排序的前提是:找到最大值的位置,最后才进行 1 次交换;\n",
+ "而冒泡排序是:相邻的值进行交换,一共进行 n 次交换"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[5, 1, 9, 3, 2, 7]\n",
+ "1 [5, 1, 7, 3, 2, 9]\n",
+ "2 [5, 1, 2, 3, 7, 9]\n",
+ "3 [3, 1, 2, 5, 7, 9]\n",
+ "4 [2, 1, 3, 5, 7, 9]\n",
+ "5 [1, 2, 3, 5, 7, 9]\n",
+ "result: [1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def selection_sort(nums):\n",
+ " length = len(nums) - 1\n",
+ "\n",
+ " while length:\n",
+ " index = length\n",
+ " # 第一个数字,和后面每一个数字进行对比,找出最大值,放到最后!!\n",
+ " for j in range(length):\n",
+ " if nums[j] > nums[index]:\n",
+ " index = j\n",
+ " nums[length], nums[index] = nums[index], nums[length]\n",
+ " print(len(nums) - length, nums)\n",
+ " length -= 1\n",
+ " \n",
+ "if __name__ == \"__main__\":\n",
+ " nums = [5, 1, 9, 3, 2, 7]\n",
+ " print(nums)\n",
+ " selection_sort(nums)\n",
+ " print(\"result: \" + str(nums))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 4、快速排序(Quick Sort)\n",
+ "\n",
+ "### 4.1、简介\n",
+ "\n",
+ "快速排序的基本思想:通过一趟排序将待排记录分隔成独立的两部分,其中一部分记录的关键字均比另一部分的关键字小,则可分别对这两部分记录继续进行排序,以达到整个序列有序。\n",
+ "\n",
+ "### 4.2、算法描述\n",
+ "\n",
+ "快速排序使用分治法来把一个串(list)分为两个子串(sub-lists)。具体算法描述如下:\n",
+ "\n",
+ " - 从数列中挑出一个元素,称为 \"基准\"(pivot)\n",
+ " - 重新排序数列,所有元素比基准值小的摆放在基准前面,所有元素比基准值大的摆在基准的后面(相同的数可以到任一边)。在这个分区退出后,该基准就处于数列的中间位置。这个称为分区(partition)操作;\n",
+ " - 递归地(recursive)把小于基准值元素的子数列和大于基准值元素的子数列排序。\n",
+ " \n",
+ "### 4.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 4.4、代码实现"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "5 7 ******************************\n",
+ "5 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "5 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "5 9 ******************************\n",
+ "5 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "2 3 ******************************\n",
+ "2 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "9 7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def quick_sort(nums, start, end):\n",
+ " i = start\n",
+ " j = end\n",
+ " # 结束排序\n",
+ " if i >= j:\n",
+ " return\n",
+ " # 保存首个数值\n",
+ " key = nums[i]\n",
+ " # 一次排序,i和j的值不断的靠拢,然后最终停止,结束一次排序\n",
+ " while i < j:\n",
+ " # 和最右边的比较,如果值 >=key,然后j-1,慢慢的和前一个值比较;如果值key,那么就交换位置\n",
+ " while i < j and key >= nums[i]:\n",
+ " print(key, nums[i], '%' * 30)\n",
+ " i += 1\n",
+ " nums[j] = nums[i]\n",
+ " nums[i] = key\n",
+ " # 左边排序\n",
+ " quick_sort(nums, start, j-1)\n",
+ " # 右边排序\n",
+ " quick_sort(nums, i+1, end)\n",
+ "\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " l = [5, 1, 9, 3, 2, 7]\n",
+ " quick_sort(l, 0, len(l) - 1)\n",
+ " print(l)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 5、希尔排序(ShellSort)\n",
+ "\n",
+ "### 5.1、简介\n",
+ "\n",
+ "希尔排序(Shell Sort)也是插入排序的一种。也称为缩小增量排序,是直接插入排序算法的一种更高效的改进版本。希尔排序是非稳定排序算法。该方法因DL.Shell于1959年提出而得名。\n",
+ "\n",
+ "1959年Shell发明,第一个突破O(n2)的排序算法,是简单插入排序的改进版。它与插入排序的不同之处在于,它会 **优先比较距离较远的元素。希尔排序又叫缩小增量排序。**\n",
+ "\n",
+ "### 5.2、算法描述\n",
+ "\n",
+ "先将整个待排序的记录序列分割成为若干子序列分别进行直接插入排序,具体算法描述:\n",
+ "\n",
+ " - 选择一个增量序列 $t_1, t_2, …, t_k$ ,其中 $t_i>t_j, t_k=1$ ;\n",
+ " - 按增量序列个数 k,对序列进行 k 趟排序;\n",
+ " - 每趟排序,根据对应的增量 $t_i$,将待排序列分割成若干长度为 m 的子序列,分别对各子表进行直接插入排序。仅增量因子为 1 时,整个序列作为一个表来处理,表长度即为整个序列的长度。\n",
+ " \n",
+ "**补充描述:**\n",
+ " \n",
+ "是不是有些不明白呢?那我们用通俗一些的语句来说。\n",
+ "\n",
+ "直接插入排序在在本身数量比较少的时候情况下效率很高,如果待排数的数量很多,其效率不是很理想。\n",
+ "\n",
+ " 回想一下直接插入排序过程,排序过程中,我们可以设置一条线,左边是排好序的,右边则是一个一个等待排序,\n",
+ "\n",
+ "如果最小的那个值在最右边,那么排这个最小值的时候,需要将所有元素向右边移动一位。\n",
+ "\n",
+ " 是否能够减少这样的移位呢?\n",
+ "\n",
+ " 我们不希望它是一步一步的移动,而是大步大步的移动。希尔排序就被发明出来了,它也是当时打破效率\n",
+ "\n",
+ "O(n2)的算法之一。希尔排序算法通过设置一个间隔,对同样间隔的数的集合进行插入排序,此数集合中的元素\n",
+ "\n",
+ "移位的长度是以间隔的长度为准,这样就实现了大步位移。但是最后需要对元素集合进行一次直接插入排序,所以\n",
+ "\n",
+ "最后的间隔一定是1。\n",
+ "\n",
+ "下面举一个例子:\n",
+ "\n",
+ "第一趟希尔排序,间隔为4\n",
+ "\n",
+ "\n",
+ "\n",
+ "第二趟排序:间隔为 2\n",
+ "\n",
+ "\n",
+ "\n",
+ "第三趟排序,间隔为 1,即 直接插入排序法(InsertSort):\n",
+ "\n",
+ "具体的插入排序过程,这里我们就不再详细说了。\n",
+ "\n",
+ "```\n",
+ "减小间隔:\n",
+ "\n",
+ "上面已经演示了以4为初始间隔对包含10个数据项的数组进行排序的情况。对于更大的数组开始的间隔也应该更大。然后间隔不断减小,直到间隔变成1。\n",
+ "\n",
+ "举例来说,含有1000个数据项的数组可能先以364为增量,然后以121为增量,以40为增量,以13为增量,以4为增量,最后以 1为增量进行希尔排序。用来形成间隔的数列被称为间隔序列。这里所表示的间隔序列由Knuth提出,此序列是很常用的。数列以逆向形式从1开始,通过递归表达式\n",
+ "\n",
+ "h = 3 * b + 1\n",
+ "\n",
+ "来产生,初始值为 1 。\n",
+ "\n",
+ "在排序算法中,首先在一个短小的循环中使用序列的生成公式来计算出最初的间隔。h值最初被赋为1,然后应用公式h=3*h+1生成序列1,4,13,40,121,364,等等。当间隔大于数组大小的时候,这个过程停止。对于一个含有1000个数据项的数组,序列的第七个数字,1093就太大了。因此,使用序列的第六个数字作为最大的数字来开始这个排序过程,作364-增量排序。然后,每完成一次排序全程的外部循环,用前面提供的此公式倒推式来减小间隔:\n",
+ "\n",
+ "h=(h-1)/3\n",
+ "\n",
+ "这个倒推的公式生成逆置的序列364,121,40,13,4,1。从364开始,以每一个数字作为增量进行排序。当数组用1-增量排序后,算法结束。\n",
+ "\n",
+ "希尔排序比插入排序快很多,它是基于什么原因呢?当h值大的时候,数据项每一趟排序需要移动元素的个数很少,但数据项移动的距离很长。这是非常有效率的。当h减小时,每一趟排序需要移动的元素的个数增多,但是此时数据项已经接近于它们排序后最终的位置,这对于插入排序可以更有效率。正是这两种情况的结合才使希尔排序效率那么高。\n",
+ "\n",
+ "注意后期的排序过程不撤销前期排序所做的工作。例如,已经完成了以40-增量的排序的数组,在经过以13-增量的排序后仍然保持了以40-增量的排序的结果。如果不是这样的话,希尔排序就无法实现排序的目的。\n",
+ "```\n",
+ " \n",
+ "### 5.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "再附加一个静态图:\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 5.4、代码实现"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "开始 [5, 2, 9, 8, 1, 10, 3, 4, 7]\n",
+ "3 -- [3, 2, 9, 5, 1, 10, 8, 4, 7]\n",
+ "3 -- [3, 1, 9, 5, 2, 10, 8, 4, 7]\n",
+ "3 -- [3, 1, 7, 5, 2, 9, 8, 4, 10]\n",
+ "2 -- [2, 1, 3, 5, 7, 9, 8, 4, 10]\n",
+ "2 -- [2, 1, 3, 4, 7, 5, 8, 9, 10]\n",
+ "1 -- [1, 2, 3, 4, 5, 7, 8, 9, 10]\n",
+ "结束 [1, 2, 3, 4, 5, 7, 8, 9, 10]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 直接插入排序\n",
+ "def insert_sort(nums, start, increment):\n",
+ " for i in range(start+increment, len(nums), increment):\n",
+ " for j in range(start, len(nums[:i]), increment):\n",
+ " if nums[i] < nums[j]:\n",
+ " nums[i], nums[j] = nums[j], nums[i]\n",
+ " print(increment, '--', nums)\n",
+ " return nums\n",
+ "\n",
+ "# 希尔排序\n",
+ "def shell_sort(nums, increment):\n",
+ " # 依次进行分层\n",
+ " while increment:\n",
+ " # 每一层,都进行n次插入排序\n",
+ " for i in range(0, increment):\n",
+ " insert_sort(nums, i, increment)\n",
+ " increment -= 1\n",
+ " return nums\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " l = [5, 2, 9, 8, 1, 10, 3, 4, 7]\n",
+ " increment = int(len(l)/3)+1 if len(l)%3 else int(len(l)/3)\n",
+ " print(\"开始\", l)\n",
+ " l = shell_sort(l, increment)\n",
+ " print(\"结束\", l)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 6、归并排序(MergeSort)\n",
+ "\n",
+ "### 6.1、简介\n",
+ "\n",
+ "归并排序是建立在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。将已有序的子序列合并,得到完全有序的序列;即先使每个子序列有序,再使子序列段间有序。若将两个有序表合并成一个有序表,称为2-路归并。\n",
+ "\n",
+ "### 6.2、算法描述\n",
+ "\n",
+ " - 把长度为 n 的输入序列分成两个长度为 n/2 的子序列;\n",
+ " - 对这两个子序列分别采用归并排序;\n",
+ " - 将两个排序好的子序列合并成一个最终的排序序列。\n",
+ " \n",
+ "### 6.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 6.4、代码实现\n",
+ "\n",
+ "归并排序是一种稳定的排序方法。和选择排序一样,归并排序的性能不受输入数据的影响,但表现比选择排序好的多,因为始终都是O(nlogn)的时间复杂度。代价是需要额外的内存空间。"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1]\n",
+ "********************\n",
+ "[2]\n",
+ "____________________\n",
+ "result: [1, 2]\n",
+ "[4]\n",
+ "********************\n",
+ "[5]\n",
+ "____________________\n",
+ "result: [4, 5]\n",
+ "[3]\n",
+ "********************\n",
+ "[4, 5]\n",
+ "____________________\n",
+ "result: [3, 4, 5]\n",
+ "[1, 2]\n",
+ "********************\n",
+ "[3, 4, 5]\n",
+ "____________________\n",
+ "result: [1, 2, 3, 4, 5]\n",
+ "[7]\n",
+ "********************\n",
+ "[90]\n",
+ "____________________\n",
+ "result: [7, 90]\n",
+ "[6]\n",
+ "********************\n",
+ "[7, 90]\n",
+ "____________________\n",
+ "result: [6, 7, 90]\n",
+ "[23]\n",
+ "********************\n",
+ "[45]\n",
+ "____________________\n",
+ "result: [23, 45]\n",
+ "[21]\n",
+ "********************\n",
+ "[23, 45]\n",
+ "____________________\n",
+ "result: [21, 23, 45]\n",
+ "[6, 7, 90]\n",
+ "********************\n",
+ "[21, 23, 45]\n",
+ "____________________\n",
+ "result: [6, 7, 21, 23, 45, 90]\n",
+ "[1, 2, 3, 4, 5]\n",
+ "********************\n",
+ "[6, 7, 21, 23, 45, 90]\n",
+ "____________________\n",
+ "result: [1, 2, 3, 4, 5, 6, 7, 21, 23, 45, 90]\n",
+ "[1, 2, 3, 4, 5, 6, 7, 21, 23, 45, 90]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def MergeSort(lists):\n",
+ " if len(lists) <= 1:\n",
+ " return lists\n",
+ " num = int(len(lists) / 2)\n",
+ " # 从中间,进行数据的拆分, 递归的返回数据进行迭代排序\n",
+ " left = MergeSort(lists[:num])\n",
+ " right = MergeSort(lists[num:])\n",
+ " print(left)\n",
+ " print(\"*\" * 20)\n",
+ " print(right)\n",
+ " print(\"_\" * 20)\n",
+ " return Merge(left, right)\n",
+ "\n",
+ "# 将 2 个已经排好序的子序列合并成一个序列,也就是 2-路归并\n",
+ "def Merge(left, right):\n",
+ " r, l = 0, 0\n",
+ " result = []\n",
+ " # 这里将两个序列中的每个值都比较一下,最小的放到最左边\n",
+ " while l < len(left) and r < len(right):\n",
+ " if left[l] < right[r]:\n",
+ " result.append(left[l])\n",
+ " l += 1\n",
+ " else:\n",
+ " result.append(right[r])\n",
+ " r += 1\n",
+ " result += right[r:]\n",
+ " result += left[l:]\n",
+ " print('result:', result)\n",
+ " # 最终将合并好的完整序列返回\n",
+ " return result\n",
+ "\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " print(MergeSort([1, 2, 3, 4, 5, 6, 7, 90, 21, 23, 45]))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 7、基数排序\n",
+ "\n",
+ "### 7.1、简介\n",
+ "\n",
+ "以十进制为例,基数指的是数的位,如个位,十位百位等。而以十六进制为例,0xB2,就有两个radices(radix的复数)。\n",
+ "\n",
+ "基数排序是按照低位先排序,然后收集;再按照高位排序,然后再收集;依次类推,直到最高位。有时候有些属性是有优先级顺序的,先按低优先级排序,再按高优先级排序。最后的次序就是高优先级高的在前,高优先级相同的低优先级高的在前。\n",
+ "\n",
+ "### 7.2、算法描述\n",
+ "\n",
+ " - 取得数组中的最大数,并取得位数;\n",
+ " - arr 为原始数组,从最低位开始取每个位组成 radix 数组;\n",
+ " - 对 radix 进行计数排序(利用计数排序适用于小范围数的特点)\n",
+ " \n",
+ "**补充描述:**\n",
+ "\n",
+ "基数排序不同于其他的排序算法,它不是基于比较的算法。基数排序是一种借助多关键字排序的思想对单逻辑关键字进行排序的方法。它是一种稳定的排序算法。多关键字排序中有两种方法:最高位优先法(MSD)和最低位优先法(LSD)。通常用于对数的排序选择的是最低位优先法,即先对最次位关键字进行排序,再对高一位的关键字进行排序,以此类推。\n",
+ "\n",
+ "算法的思想:类似于桶式排序,我们需要给待排序记录准备10个桶,为什么是10个??因为一个数的任何一位上,其数字大小都位于0~9之间,因此采用10个桶,桶的编号分别为0,1,2,3,4...9,对应待排序记录中每个数相应位的数值,基数排序也是因此而得名。我们先根据待排序记录的每个数的个位来决定让其加入哪个桶中。例如:待排序数组为\n",
+ "\n",
+ "278 109 63 930 589 184 505 269 8 83\n",
+ "\n",
+ "求取每个数的个位数,依次为:8 9 3 0 9 4 5 9 8 3\n",
+ "\n",
+ "依照其个位数决定将其加入哪个桶中\n",
+ "\n",
+ "\n",
+ " \n",
+ "### 7.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 7.4、代码实现\n",
+ "\n",
+ "基数排序基于分别排序,分别收集,所以是稳定的。但基数排序的性能比桶排序要略差,每一次关键字的桶分配都需要 $O(n)$ 的时间复杂度,而且分配之后得到新的关键字序列又需要 $O(n)$ 的时间复杂度。假如待排数据可以分为 $d$ 个关键字,则基数排序的时间复杂度将是 $O(d*2n)$ ,当然 $d$ 要远远小于 $n$ ,因此基本上还是线性级别的。\n",
+ "\n",
+ "基数排序的空间复杂度为 $O(n+k)$ ,其中 $k$ 为桶的数量。一般来说 $n>>k$ ,因此额外空间需要大概 $n$ 个左右。"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# ************************基数排序****************************\n",
+ "# 确定排序的次数\n",
+ "# 排序的顺序跟序列中最大数的位数相关\n",
+ "def radix_sort_nums(L):\n",
+ " maxNum = L[0]\n",
+ " #寻找序列中的最大数\n",
+ " for x in L:\n",
+ " if maxNum < x:\n",
+ " maxNum = x\n",
+ " # 确定序列中的最大元素的位数\n",
+ " times = 0\n",
+ " while (maxNum > 0):\n",
+ " maxNum = int((maxNum/10))\n",
+ " times += 1\n",
+ " return times\n",
+ "\n",
+ "# 找到num从低到高第pos位的数据\n",
+ "def get_num_pos(num, pos):\n",
+ " return (int((num/(10**(pos-1))))) % 10\n",
+ "\n",
+ "# 基数排序\n",
+ "def radix_sort(L):\n",
+ " count = 10 * [None] # 存放各个桶的数据统计个数\n",
+ " bucket = len(L) * [None] # 暂时存放排序结果\n",
+ " # 从低位到高位依次执行循环\n",
+ " for pos in range(1, radix_sort_nums(L)+1):\n",
+ " # 置空各个桶的数据统计\n",
+ " for x in range(0, 10):\n",
+ " count[x] = 0\n",
+ " # 统计当前该位(个位,十位,百位....)的元素数目\n",
+ " for x in range(0, len(L)):\n",
+ " # 统计各个桶将要装进去的元素个数\n",
+ " j = get_num_pos(int(L[x]), pos)\n",
+ " count[j] += 1\n",
+ " # count[i]表示第i个桶的右边界索引\n",
+ " for x in range(1,10):\n",
+ " count[x] += count[x-1]\n",
+ " # 将数据依次装入桶中\n",
+ " for x in range(len(L)-1, -1, -1):\n",
+ " # 求出元素第K位的数字\n",
+ " j = get_num_pos(L[x], pos)\n",
+ " # 放入对应的桶中,count[j]-1是第j个桶的右边界索引\n",
+ " bucket[count[j]-1] = L[x]\n",
+ " # 对应桶的装入数据索引-1\n",
+ " count[j] -= 1\n",
+ " # 将已分配好的桶中数据再倒出来,此时已是对应当前位数有序的表\n",
+ " for x in range(0, len(L)):\n",
+ " L[x] = bucket[x]\n",
+ " \n",
+ "if __name__ == \"__main__\":\n",
+ " l = [5, 1, 9, 3, 2, 7]\n",
+ " radix_sort(l)\n",
+ " print(l)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.6.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/docs/Algorithm/DataStructure/Java/Sort/insertionSort.py b/docs/Algorithm/DataStructure/Java/Sort/insertionSort.py
new file mode 100755
index 00000000..29f975d7
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Java/Sort/insertionSort.py
@@ -0,0 +1,16 @@
+def insertionSort(nums):
+ if not nums or len(nums) < 2:
+ return nums
+
+ for i in range(1, len(nums)):
+ for j in range(i):
+ if nums[i] < nums[j]:
+ nums[i], nums[j] = nums[j], nums[i]
+ return nums
+
+
+if __name__ == "__main__":
+ nums = [5, 1, 9, 3, 2, 7]
+ print('input: ', nums)
+ nums = insertionSort(nums)
+ print("result: ", nums)
diff --git "a/docs/Algorithm/DataStructure/Java/Sort/\346\216\222\345\272\217\347\250\263\345\256\232\346\200\247.md" "b/docs/Algorithm/DataStructure/Java/Sort/\346\216\222\345\272\217\347\250\263\345\256\232\346\200\247.md"
new file mode 100755
index 00000000..08b1c964
--- /dev/null
+++ "b/docs/Algorithm/DataStructure/Java/Sort/\346\216\222\345\272\217\347\250\263\345\256\232\346\200\247.md"
@@ -0,0 +1 @@
+https://baike.baidu.com/item/%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95%E7%A8%B3%E5%AE%9A%E6%80%A7
diff --git a/docs/Algorithm/DataStructure/Java/Traversals/README.md b/docs/Algorithm/DataStructure/Java/Traversals/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/JavaScript.md b/docs/Algorithm/DataStructure/JavaScript/README.md
old mode 100644
new mode 100755
similarity index 100%
rename from docs/Algorithm/DataStructure/JavaScript.md
rename to docs/Algorithm/DataStructure/JavaScript/README.md
diff --git a/docs/Algorithm/DataStructure/Python/Cipher/README.md b/docs/Algorithm/DataStructure/Python/Cipher/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/img/Algorithm/LeetCode/033/1.md b/docs/Algorithm/DataStructure/Python/Compression/README.md
old mode 100644
new mode 100755
similarity index 100%
rename from img/Algorithm/LeetCode/033/1.md
rename to docs/Algorithm/DataStructure/Python/Compression/README.md
diff --git a/docs/Algorithm/DataStructure/Python/Conversion/README.md b/docs/Algorithm/DataStructure/Python/Conversion/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/Python/Data_Structure/Graph/README.md b/docs/Algorithm/DataStructure/Python/Data_Structure/Graph/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Data_Structure/Graph/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Python/Data_Structure/HashMap/README.md b/docs/Algorithm/DataStructure/Python/Data_Structure/HashMap/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Data_Structure/HashMap/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Python/Data_Structure/HashTable/README.md b/docs/Algorithm/DataStructure/Python/Data_Structure/HashTable/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Data_Structure/HashTable/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Python/Data_Structure/Heqp/README.md b/docs/Algorithm/DataStructure/Python/Data_Structure/Heqp/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Data_Structure/Heqp/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Python/Data_Structure/LinkedList/README.md b/docs/Algorithm/DataStructure/Python/Data_Structure/LinkedList/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Data_Structure/LinkedList/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Python/Data_Structure/Matrix/README.md b/docs/Algorithm/DataStructure/Python/Data_Structure/Matrix/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Data_Structure/Matrix/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Queue/README.md b/docs/Algorithm/DataStructure/Python/Data_Structure/Queue/README.md
old mode 100644
new mode 100755
similarity index 100%
rename from docs/Algorithm/DataStructure/Queue/README.md
rename to docs/Algorithm/DataStructure/Python/Data_Structure/Queue/README.md
diff --git a/img/Algorithm/LeetCode/042/1.md b/docs/Algorithm/DataStructure/Python/Data_Structure/README.md
old mode 100644
new mode 100755
similarity index 100%
rename from img/Algorithm/LeetCode/042/1.md
rename to docs/Algorithm/DataStructure/Python/Data_Structure/README.md
diff --git a/docs/Algorithm/DataStructure/Stack/README.md b/docs/Algorithm/DataStructure/Python/Data_Structure/Stack/README.md
old mode 100644
new mode 100755
similarity index 100%
rename from docs/Algorithm/DataStructure/Stack/README.md
rename to docs/Algorithm/DataStructure/Python/Data_Structure/Stack/README.md
diff --git a/docs/Algorithm/DataStructure/Python/Data_Structure/Tree/README.md b/docs/Algorithm/DataStructure/Python/Data_Structure/Tree/README.md
new file mode 100755
index 00000000..fe9c7bbf
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Data_Structure/Tree/README.md
@@ -0,0 +1,15 @@
+# Some algorithm templates for better understanding!
+
+## 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/opt/git/LeetCode/docs/Algorithm\ Templates/Sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) |
+| 基数排序 |  | |
diff --git a/docs/Algorithm/DataStructure/Python/Dynamic_Programming/README.md b/docs/Algorithm/DataStructure/Python/Dynamic_Programming/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/Python/Hash/README.md b/docs/Algorithm/DataStructure/Python/Hash/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/Python/Others/NextNodeInOrderTree.md b/docs/Algorithm/DataStructure/Python/Others/NextNodeInOrderTree.md
new file mode 100755
index 00000000..28a10248
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Others/NextNodeInOrderTree.md
@@ -0,0 +1,45 @@
+``` python
+ 8
+ /
+ 5
+ / \
+ 3 6
+ / \ \
+ 1 4 7
+
+
+class Node {
+ Node parent, lc, rc;
+ int val;
+}
+```
+
+1. 首先判断其自有无右孩子,若有,则取其右子树的最左节点; 若无,则开始2
+
+
+2. 它是其父亲节点的左孩子,则其父亲节点
+
+
+2. 它是其父亲节点的右孩子,则从其父亲开始往上追溯到第一个向右的节点,如果没有这个节点或者说没有父亲节点,则无下一个节点,若有则取之
+
+
+```python
+def nextNode(node):
+ def leftest(node):
+ while node.lc:
+ node = node.lc
+ return node
+ if node.rc:
+ return leftest(node.rc)
+ if not node.parent:
+ return None
+ if node == node.parent.lc:
+ return node.parent
+ elif node == node.parent.rc:
+ while node.parent.parent:
+ if node.parent != node.parent.parent.lc:
+ node = node.parent
+ else:
+ return node.parent.parent
+ return None
+```
diff --git a/docs/Algorithm/DataStructure/Python/Others/TopKWords.java b/docs/Algorithm/DataStructure/Python/Others/TopKWords.java
new file mode 100755
index 00000000..c9f13800
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Others/TopKWords.java
@@ -0,0 +1,86 @@
+import java.io.*;
+import java.util.*;
+
+/* display the most frequent K words in the file and the times it appear
+ in the file – shown in order (ignore case and periods) */
+
+public class TopKWords {
+ static class CountWords {
+ private String fileName;
+
+ public CountWords(String fileName) {
+ this.fileName = fileName;
+ }
+
+ public Map getDictionary() {
+ Map dictionary = new HashMap<>();
+ FileInputStream fis = null;
+
+ try {
+
+ fis = new FileInputStream(fileName); // open the file
+ int in = 0;
+ String s = ""; // init a empty word
+ in = fis.read(); // read one character
+
+ while (-1 != in) {
+ if (Character.isLetter((char)in)) {
+ s += (char)in; //if get a letter, append to s
+ } else {
+ // this branch means an entire word has just been read
+ if (s.length() > 0) {
+ // see whether word exists or not
+ if (dictionary.containsKey(s)) {
+ // if exist, count++
+ dictionary.put(s, dictionary.get(s) + 1);
+ } else {
+ // if not exist, initiate count of this word with 1
+ dictionary.put(s, 1);
+ }
+ }
+ s = ""; // reInit a empty word
+ }
+ in = fis.read();
+ }
+ return dictionary;
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ // you always have to close the I/O streams
+ fis.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+ }
+ public static void main(String[] args) {
+ // you can replace the filePath with yours, e.g.
+ // CountWords cw = new CountWords("/Users/lisanaaa/Desktop/words.txt");
+ CountWords cw = new CountWords("/words.txt");
+ Map dictionary = cw.getDictionary(); // get the words dictionary: {word: frequency}
+
+ // we change the map to list for convenient sort
+ List> list = new ArrayList<>(dictionary.entrySet());
+
+ // sort by lambda valueComparator
+ list.sort(Comparator.comparing(
+ m -> m.getValue())
+ );
+
+ Scanner input = new Scanner(System.in);
+ int k = input.nextInt();
+ while (k > list.size()) {
+ System.out.println("Retype a number, your number is too large");
+ input = new Scanner(System.in);
+ k = input.nextInt();
+ }
+ for (int i = 0; i < k; i++) {
+ System.out.println(list.get(list.size() - i - 1));
+ }
+ }
+}
+
+
diff --git a/docs/Algorithm/DataStructure/Python/Others/words.txt b/docs/Algorithm/DataStructure/Python/Others/words.txt
new file mode 100755
index 00000000..b3c4b567
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Others/words.txt
@@ -0,0 +1,11 @@
+
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam non pharetra purus. Quisque non tristique risus. Nulla ultricies eget nunc a volutpat. Aliquam semper, eros sit amet semper pellentesque, elit magna auctor ligula, sit amet vulputate nunc arcu sit amet ipsum. Aenean efficitur, felis ut tincidunt semper, sem sapien facilisis felis, et elementum ipsum risus sit amet metus. Pellentesque et orci at odio hendrerit lobortis vitae non felis. Phasellus nunc eros, ultricies sed dolor vel, ultricies mattis neque. Mauris placerat fringilla libero id efficitur. Donec nec imperdiet augue. Sed sit amet risus in turpis scelerisque rutrum. Ut sed pretium dolor. Donec metus nisl, blandit quis augue et, interdum suscipit metus. Morbi rutrum eros vel lacus aliquet, et maximus erat dapibus. Vivamus est justo, sagittis a augue id, vulputate vehicula nunc. Praesent mattis eros sapien, ac sagittis urna accumsan sit amet. Proin non dui tincidunt, tristique nisi in, vestibulum lorem.
+
+Quisque fermentum justo lacus, sit amet tempus lectus congue eu. Nulla sed quam nec nulla consequat tincidunt. Sed sed nunc diam. Integer ex ante, accumsan id fermentum a, interdum eu sapien. Aliquam justo dui, luctus vel ligula in, lacinia ornare turpis. Praesent leo purus, fringilla ut lobortis et, porta ac urna. Mauris id velit porta, iaculis felis non, sagittis nunc. Quisque non condimentum nisl, vitae venenatis urna. Nam commodo euismod felis, ac efficitur turpis scelerisque nec. Phasellus sagittis nec lacus eu bibendum. Suspendisse finibus vestibulum quam, quis volutpat ante. Duis nibh ligula, dapibus at est sed, tincidunt convallis augue. Pellentesque non consequat mi. Curabitur consequat imperdiet efficitur.
+
+Mauris ipsum arcu, fermentum in urna ultricies, venenatis vehicula nisl. Donec viverra non tellus sit amet porta. Phasellus ornare magna eget condimentum mollis. In hac habitasse platea dictumst. Proin in nibh venenatis, fermentum neque nec, commodo urna. In eget condimentum risus, ac interdum dolor. Sed ut neque sapien. Proin nulla diam, lobortis sed ultrices eget, blandit ut libero.
+
+Fusce at varius dui. Quisque viverra vulputate consectetur. Quisque sagittis id ante a vestibulum. Phasellus vel lobortis lectus. Duis vestibulum, quam vel congue elementum, lacus nibh efficitur odio, consectetur dapibus ipsum velit at diam. Duis eu nunc id diam tempor vestibulum sed luctus arcu. Nunc eu luctus ex. Morbi et commodo eros, non suscipit enim. Ut fringilla odio nec tincidunt scelerisque. Nam quis elit cursus, ullamcorper lorem id, convallis dui. Mauris elementum tortor odio, nec imperdiet nisl bibendum eget. Suspendisse potenti.
+
+Cras ut efficitur enim. Sed consequat non ante id euismod. Ut at magna viverra, aliquam purus a, lobortis mi. Donec hendrerit odio eu nunc imperdiet, quis pharetra sapien volutpat. Morbi leo libero, egestas vitae tortor eget, dictum volutpat augue. Donec arcu lacus, tristique eu posuere ac, pharetra vel ante. Nunc efficitur arcu elit, quis semper risus vestibulum eu.
diff --git a/docs/Algorithm/DataStructure/Python/README.md b/docs/Algorithm/DataStructure/Python/README.md
new file mode 100755
index 00000000..6889eed1
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/README.md
@@ -0,0 +1,5 @@
+# Some algorithm templates for better understanding!
+
+> [八大排序算法 集合](/docs/Algorithm/Sort)
+
+
diff --git a/docs/Algorithm/DataStructure/Python/Search/README.md b/docs/Algorithm/DataStructure/Python/Search/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/Python/Sort/README.md b/docs/Algorithm/DataStructure/Python/Sort/README.md
new file mode 100755
index 00000000..7f01a8d7
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Sort/README.md
@@ -0,0 +1,13 @@
+# 八大排序算法
+
+
+
+| 名称 | 动图 | 代码 |
+| --- | --- | --- |
+| 冒泡排序 |  | [BubbleSort.py](/src/py3.x/sort/BubbleSort.py) |
+| 插入排序 |  | [InsertSort.py](/src/py3.x/sort/InsertSort.py) |
+| 选择排序 |  | [SelectionSort.py](/src/py3.x/sort/SelectionSort.py) |
+| 快速排序 |  | [QuickSort.py](/src/py3.x/sort/QuickSort.py) |
+| 希尔排序 |  | [ShellSort.py](/src/py3.x/sort/ShellSort.py) |
+| 归并排序 |  | [MergeSort.py](/src/py3.x/sort/MergeSort.py) |
+| 基数排序 |  | [RadixSort.py](/src/py3.x/sort/RadixSort.py) |
diff --git a/docs/Algorithm/DataStructure/Python/Sort/Sort.ipynb b/docs/Algorithm/DataStructure/Python/Sort/Sort.ipynb
new file mode 100755
index 00000000..a38ab891
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Sort/Sort.ipynb
@@ -0,0 +1,772 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# 排序算法\n",
+ "\n",
+ "## 1、冒泡排序(Bubble Sort)\n",
+ "\n",
+ "### 1.1、简介\n",
+ "\n",
+ "冒泡排序是一种简单的排序算法。它重复地走访过要排序的数列,一次比较两个元素,如果它们两个的顺序错误就把它们两个交换。走访数列的工作是重复的,直到最后没有再需要交换,也就是说该数列已经排序完成了。这个算法的名字由来是因为越小的元素会经由交换慢慢 \"浮\" 到数列的顶端。\n",
+ "\n",
+ "### 1.2、算法描述\n",
+ "\n",
+ " - 比较相邻的元素。如果第一个比第二个大,就交换它们两个;\n",
+ " - 对每一组相邻元素做相同的工作,从开始第一对到结尾的最后一对,这样在最后的元素应该会是最大的数;\n",
+ " - 针对所有的元素重复以上的步骤,除了最后一个;\n",
+ " - 重复步骤 1~3 ,直到排序完成。\n",
+ " \n",
+ "### 1.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 1.4、代码实现"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def bubble_sort(nums):\n",
+ " # 外层循环负责设置冒泡排序进行的次数\n",
+ " for i in range(len(nums)-1):\n",
+ " # 内层循环负责前后两两比较,求最大值放到最后\n",
+ " # j 为列表下标\n",
+ " for j in range(len(nums)-1-i):\n",
+ " # 如果相互比较的两个数,前一个数比后一个数大\n",
+ " if nums[j] > nums[j+1]:\n",
+ " nums[j], nums[j+1] = nums[j+1], nums[j]\n",
+ " return nums\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " nums = [5, 1, 9, 3, 2, 7]\n",
+ " bubble_sort(nums)\n",
+ " print(nums)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### 1.5、代码优化\n",
+ "\n",
+ "#### 1.5.1、优化 1\n",
+ "\n",
+ "如果上面代码中,里面一层循环在某次扫描中没有执行交换,则说明此时数组已经全部有序了,无需再进行扫描。因此,我们增加一个标记,每次发生交换,用来标记,如果某次循环完没有标记,则说明已经完成排序。"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 改进版的冒泡排序_1\n",
+ "def bubble_sort_2(nums):\n",
+ " # 外层循环负责设置冒泡排序进行的次数\n",
+ " for i in range(len(nums)-1):\n",
+ " # 标记是否已经完成排序\n",
+ " swaped = False\n",
+ " # 内层循环负责前后两两比较,求最大值放到最后,j 为列表下标\n",
+ " for j in range(len(nums)-1-i):\n",
+ " # 如果相互比较的两个数,前一个数比后一个数大\n",
+ " if nums[j] > nums[j+1]:\n",
+ " nums[j], nums[j+1] = nums[j+1], nums[j]\n",
+ " swaped = True\n",
+ " # 如果上一次扫描没有发生交换,说明数组已经全部都排好序了,那我们就退出循环\n",
+ " if not swaped:\n",
+ " break\n",
+ " return nums\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " nums = [5, 1, 9, 3, 2, 7]\n",
+ " bubble_sort_2(nums)\n",
+ " print(nums)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "#### 1.5.2、优化 2\n",
+ "\n",
+ "在我们第一步优化的基础上,我们可以进一步思考:如果 R[0 ~ i] 已是有序区间,上次扫描的区间是 R[i ~ n],记上次扫描时最后一次执行交换的位置为 lastSwapPos,则 lastSwapPos 在 i 与 n 之间,不难发现 R[i ~ lastSwapPos] 区间也是有序的,否则这个区间也会发生变换;所以下次扫描区间就可以由 R[i ~ n] 缩减到 R[lastSwapPos ~ n] 。"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 改进版的冒泡排序_2\n",
+ "def bubble_sort_3(nums):\n",
+ " lastSwapPos = 0\n",
+ " lastSwapPosTemp = 0\n",
+ " # 外层循环负责设置冒泡排序进行的次数\n",
+ " for i in range(len(nums)-1):\n",
+ " lastSwapPos = lastSwapPosTemp\n",
+ " # 内层循环负责前后两两比较,求最大值放到最后,j 为列表下标\n",
+ " for j in range(len(nums)-1-i):\n",
+ " # 如果相互比较的两个数,前一个数比后一个数大\n",
+ " if nums[j] > nums[j+1]:\n",
+ " nums[j], nums[j+1] = nums[j+1], nums[j]\n",
+ " # 记录最后一次发生交换的位置\n",
+ " lastSwapPosTemp = j\n",
+ " # 如果上一次扫描没有发生交换,说明数组已经全部都排好序了,那我们就退出循环\n",
+ " if lastSwapPos == lastSwapPosTemp:\n",
+ " break\n",
+ " return nums\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " nums = [5, 1, 9, 3, 2, 7]\n",
+ " bubble_sort_3(nums)\n",
+ " print(nums)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 2、插入排序(Insert Sort)\n",
+ "\n",
+ "### 2.1、简介\n",
+ "\n",
+ "插入排序(insert sort)的算法描述是一种简单直观的排序算法。它的工作原理是通过构建有序序列,对于未排序数据,在已排序序列中从后向前扫描,找到相应位置并插入。\n",
+ "\n",
+ "### 2.2、算法描述\n",
+ "\n",
+ "一般来说,插入排序都采用 in-place 在数组上实现。具体算法描述如下:\n",
+ "\n",
+ " - 从第一个元素开始,该元素可以认为已经被排序;\n",
+ " - 取出下一个元素,在已经排序的元素序列中从后向前扫描;\n",
+ " - 如果该元素(已排序)大于新元素,将该元素移到下一个位置;\n",
+ " - 重复步骤 3 ,直到找到已排序的元素小于或者等于新元素的位置;\n",
+ " - 将新元素插入到该位置后;\n",
+ " - 重复步骤 2 ~ 5\n",
+ " \n",
+ "### 2.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 2.4、代码实现\n",
+ "\n",
+ "插入排序和冒泡排序的区别在于:\n",
+ "\n",
+ " - 插入排序的前提是:左边是有序的数列\n",
+ " - 冒泡排序:相邻的值进行交换,一共进行 n 次"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[5, 1, 9, 3, 2, 7]\n",
+ "[5]\n",
+ "[1, 5]\n",
+ "[1, 5, 9]\n",
+ "[1, 3, 5, 9]\n",
+ "[1, 2, 3, 5, 9]\n",
+ "result: [1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def insert_sort(nums):\n",
+ " # 循环 除第一个数字组成的有序数组 以外的数字\n",
+ " for i in range(1, len(nums)):\n",
+ " # 每一个数字,依次和有序数组进行比较\n",
+ " print(nums[:i])\n",
+ " for j in range(len(nums[:i])):\n",
+ " if nums[i] < nums[j]:\n",
+ " nums[i], nums[j] = nums[j], nums[i]\n",
+ " \n",
+ "if __name__ == \"__main__\":\n",
+ " l = [5, 1, 9, 3, 2, 7]\n",
+ " print(l)\n",
+ " insert_sort(l)\n",
+ " print(\"result: \" + str(l))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 3、选择排序(SelectionSort)\n",
+ "\n",
+ "### 3.1、简介\n",
+ "\n",
+ "选择排序(Selection-sort)是一种简单直观的排序算法。它的工作原理:首先在未排序序列中找到最小(大)元素,存放到排序序列的起始位置,然后,再从剩余未排序元素中继续寻找最小(大)元素,然后放到已排序序列的末尾。以此类推,直到所有元素均排序完毕。 \n",
+ "\n",
+ "### 3.2、算法描述\n",
+ "\n",
+ "n 个记录的直接选择排序可经过 n-1 趟直接选择排序得到有序结果。具体算法描述如下:\n",
+ "\n",
+ " - 初始状态:无序区为 R[1 ... n],有序区为空;\n",
+ " - 第 i 趟排序 (i = 1, 2, 3, ... n-1) 开始时,当前有序区和无序区分别为 R[1 ... i-1] 和 R[i ... n]。该趟排序从当前无序区中 —— 选出关键字最小的记录 R[k],将它与无序区的第 1 个记录 R 交换,使 R[1 ... i] 和 R[i+1 ... n] 分别变为记录个数增加 1 个的新有序区和记录个数减少 1 个的新无序区;\n",
+ " - n-1 趟结束,数组有序化了。\n",
+ " \n",
+ "### 3.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 3.4、代码实现\n",
+ "\n",
+ "选择排序和冒泡排序的区别在于:\n",
+ "\n",
+ "选择排序的前提是:找到最大值的位置,最后才进行 1 次交换;\n",
+ "而冒泡排序是:相邻的值进行交换,一共进行 n 次交换"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[5, 1, 9, 3, 2, 7]\n",
+ "1 [5, 1, 7, 3, 2, 9]\n",
+ "2 [5, 1, 2, 3, 7, 9]\n",
+ "3 [3, 1, 2, 5, 7, 9]\n",
+ "4 [2, 1, 3, 5, 7, 9]\n",
+ "5 [1, 2, 3, 5, 7, 9]\n",
+ "result: [1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def selection_sort(nums):\n",
+ " length = len(nums) - 1\n",
+ "\n",
+ " while length:\n",
+ " index = length\n",
+ " # 第一个数字,和后面每一个数字进行对比,找出最大值,放到最后!!\n",
+ " for j in range(length):\n",
+ " if nums[j] > nums[index]:\n",
+ " index = j\n",
+ " nums[length], nums[index] = nums[index], nums[length]\n",
+ " print(len(nums) - length, nums)\n",
+ " length -= 1\n",
+ " \n",
+ "if __name__ == \"__main__\":\n",
+ " nums = [5, 1, 9, 3, 2, 7]\n",
+ " print(nums)\n",
+ " selection_sort(nums)\n",
+ " print(\"result: \" + str(nums))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 4、快速排序(Quick Sort)\n",
+ "\n",
+ "### 4.1、简介\n",
+ "\n",
+ "快速排序的基本思想:通过一趟排序将待排记录分隔成独立的两部分,其中一部分记录的关键字均比另一部分的关键字小,则可分别对这两部分记录继续进行排序,以达到整个序列有序。\n",
+ "\n",
+ "### 4.2、算法描述\n",
+ "\n",
+ "快速排序使用分治法来把一个串(list)分为两个子串(sub-lists)。具体算法描述如下:\n",
+ "\n",
+ " - 从数列中挑出一个元素,称为 \"基准\"(pivot)\n",
+ " - 重新排序数列,所有元素比基准值小的摆放在基准前面,所有元素比基准值大的摆在基准的后面(相同的数可以到任一边)。在这个分区退出后,该基准就处于数列的中间位置。这个称为分区(partition)操作;\n",
+ " - 递归地(recursive)把小于基准值元素的子数列和大于基准值元素的子数列排序。\n",
+ " \n",
+ "### 4.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 4.4、代码实现"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "5 7 ******************************\n",
+ "5 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "5 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "5 9 ******************************\n",
+ "5 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "2 3 ******************************\n",
+ "2 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "9 7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def quick_sort(nums, start, end):\n",
+ " i = start\n",
+ " j = end\n",
+ " # 结束排序\n",
+ " if i >= j:\n",
+ " return\n",
+ " # 保存首个数值\n",
+ " key = nums[i]\n",
+ " # 一次排序,i和j的值不断的靠拢,然后最终停止,结束一次排序\n",
+ " while i < j:\n",
+ " # 和最右边的比较,如果值 >=key,然后j-1,慢慢的和前一个值比较;如果值key,那么就交换位置\n",
+ " while i < j and key >= nums[i]:\n",
+ " print(key, nums[i], '%' * 30)\n",
+ " i += 1\n",
+ " nums[j] = nums[i]\n",
+ " nums[i] = key\n",
+ " # 左边排序\n",
+ " quick_sort(nums, start, j-1)\n",
+ " # 右边排序\n",
+ " quick_sort(nums, i+1, end)\n",
+ "\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " l = [5, 1, 9, 3, 2, 7]\n",
+ " quick_sort(l, 0, len(l) - 1)\n",
+ " print(l)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 5、希尔排序(ShellSort)\n",
+ "\n",
+ "### 5.1、简介\n",
+ "\n",
+ "希尔排序(Shell Sort)也是插入排序的一种。也称为缩小增量排序,是直接插入排序算法的一种更高效的改进版本。希尔排序是非稳定排序算法。该方法因DL.Shell于1959年提出而得名。\n",
+ "\n",
+ "1959年Shell发明,第一个突破O(n2)的排序算法,是简单插入排序的改进版。它与插入排序的不同之处在于,它会 **优先比较距离较远的元素。希尔排序又叫缩小增量排序。**\n",
+ "\n",
+ "### 5.2、算法描述\n",
+ "\n",
+ "先将整个待排序的记录序列分割成为若干子序列分别进行直接插入排序,具体算法描述:\n",
+ "\n",
+ " - 选择一个增量序列 $t_1, t_2, …, t_k$ ,其中 $t_i>t_j, t_k=1$ ;\n",
+ " - 按增量序列个数 k,对序列进行 k 趟排序;\n",
+ " - 每趟排序,根据对应的增量 $t_i$,将待排序列分割成若干长度为 m 的子序列,分别对各子表进行直接插入排序。仅增量因子为 1 时,整个序列作为一个表来处理,表长度即为整个序列的长度。\n",
+ " \n",
+ "**补充描述:**\n",
+ " \n",
+ "是不是有些不明白呢?那我们用通俗一些的语句来说。\n",
+ "\n",
+ "直接插入排序在在本身数量比较少的时候情况下效率很高,如果待排数的数量很多,其效率不是很理想。\n",
+ "\n",
+ " 回想一下直接插入排序过程,排序过程中,我们可以设置一条线,左边是排好序的,右边则是一个一个等待排序,\n",
+ "\n",
+ "如果最小的那个值在最右边,那么排这个最小值的时候,需要将所有元素向右边移动一位。\n",
+ "\n",
+ " 是否能够减少这样的移位呢?\n",
+ "\n",
+ " 我们不希望它是一步一步的移动,而是大步大步的移动。希尔排序就被发明出来了,它也是当时打破效率\n",
+ "\n",
+ "O(n2)的算法之一。希尔排序算法通过设置一个间隔,对同样间隔的数的集合进行插入排序,此数集合中的元素\n",
+ "\n",
+ "移位的长度是以间隔的长度为准,这样就实现了大步位移。但是最后需要对元素集合进行一次直接插入排序,所以\n",
+ "\n",
+ "最后的间隔一定是1。\n",
+ "\n",
+ "下面举一个例子:\n",
+ "\n",
+ "第一趟希尔排序,间隔为4\n",
+ "\n",
+ "\n",
+ "\n",
+ "第二趟排序:间隔为 2\n",
+ "\n",
+ "\n",
+ "\n",
+ "第三趟排序,间隔为 1,即 直接插入排序法(InsertSort):\n",
+ "\n",
+ "具体的插入排序过程,这里我们就不再详细说了。\n",
+ "\n",
+ "```\n",
+ "减小间隔:\n",
+ "\n",
+ "上面已经演示了以4为初始间隔对包含10个数据项的数组进行排序的情况。对于更大的数组开始的间隔也应该更大。然后间隔不断减小,直到间隔变成1。\n",
+ "\n",
+ "举例来说,含有1000个数据项的数组可能先以364为增量,然后以121为增量,以40为增量,以13为增量,以4为增量,最后以 1为增量进行希尔排序。用来形成间隔的数列被称为间隔序列。这里所表示的间隔序列由Knuth提出,此序列是很常用的。数列以逆向形式从1开始,通过递归表达式\n",
+ "\n",
+ "h = 3 * b + 1\n",
+ "\n",
+ "来产生,初始值为 1 。\n",
+ "\n",
+ "在排序算法中,首先在一个短小的循环中使用序列的生成公式来计算出最初的间隔。h值最初被赋为1,然后应用公式h=3*h+1生成序列1,4,13,40,121,364,等等。当间隔大于数组大小的时候,这个过程停止。对于一个含有1000个数据项的数组,序列的第七个数字,1093就太大了。因此,使用序列的第六个数字作为最大的数字来开始这个排序过程,作364-增量排序。然后,每完成一次排序全程的外部循环,用前面提供的此公式倒推式来减小间隔:\n",
+ "\n",
+ "h=(h-1)/3\n",
+ "\n",
+ "这个倒推的公式生成逆置的序列364,121,40,13,4,1。从364开始,以每一个数字作为增量进行排序。当数组用1-增量排序后,算法结束。\n",
+ "\n",
+ "希尔排序比插入排序快很多,它是基于什么原因呢?当h值大的时候,数据项每一趟排序需要移动元素的个数很少,但数据项移动的距离很长。这是非常有效率的。当h减小时,每一趟排序需要移动的元素的个数增多,但是此时数据项已经接近于它们排序后最终的位置,这对于插入排序可以更有效率。正是这两种情况的结合才使希尔排序效率那么高。\n",
+ "\n",
+ "注意后期的排序过程不撤销前期排序所做的工作。例如,已经完成了以40-增量的排序的数组,在经过以13-增量的排序后仍然保持了以40-增量的排序的结果。如果不是这样的话,希尔排序就无法实现排序的目的。\n",
+ "```\n",
+ " \n",
+ "### 5.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "再附加一个静态图:\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 5.4、代码实现"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "开始 [5, 2, 9, 8, 1, 10, 3, 4, 7]\n",
+ "3 -- [3, 2, 9, 5, 1, 10, 8, 4, 7]\n",
+ "3 -- [3, 1, 9, 5, 2, 10, 8, 4, 7]\n",
+ "3 -- [3, 1, 7, 5, 2, 9, 8, 4, 10]\n",
+ "2 -- [2, 1, 3, 5, 7, 9, 8, 4, 10]\n",
+ "2 -- [2, 1, 3, 4, 7, 5, 8, 9, 10]\n",
+ "1 -- [1, 2, 3, 4, 5, 7, 8, 9, 10]\n",
+ "结束 [1, 2, 3, 4, 5, 7, 8, 9, 10]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 直接插入排序\n",
+ "def insert_sort(nums, start, increment):\n",
+ " for i in range(start+increment, len(nums), increment):\n",
+ " for j in range(start, len(nums[:i]), increment):\n",
+ " if nums[i] < nums[j]:\n",
+ " nums[i], nums[j] = nums[j], nums[i]\n",
+ " print(increment, '--', nums)\n",
+ " return nums\n",
+ "\n",
+ "# 希尔排序\n",
+ "def shell_sort(nums, increment):\n",
+ " # 依次进行分层\n",
+ " while increment:\n",
+ " # 每一层,都进行n次插入排序\n",
+ " for i in range(0, increment):\n",
+ " insert_sort(nums, i, increment)\n",
+ " increment -= 1\n",
+ " return nums\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " l = [5, 2, 9, 8, 1, 10, 3, 4, 7]\n",
+ " increment = int(len(l)/3)+1 if len(l)%3 else int(len(l)/3)\n",
+ " print(\"开始\", l)\n",
+ " l = shell_sort(l, increment)\n",
+ " print(\"结束\", l)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 6、归并排序(MergeSort)\n",
+ "\n",
+ "### 6.1、简介\n",
+ "\n",
+ "归并排序是建立在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。将已有序的子序列合并,得到完全有序的序列;即先使每个子序列有序,再使子序列段间有序。若将两个有序表合并成一个有序表,称为2-路归并。\n",
+ "\n",
+ "### 6.2、算法描述\n",
+ "\n",
+ " - 把长度为 n 的输入序列分成两个长度为 n/2 的子序列;\n",
+ " - 对这两个子序列分别采用归并排序;\n",
+ " - 将两个排序好的子序列合并成一个最终的排序序列。\n",
+ " \n",
+ "### 6.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 6.4、代码实现\n",
+ "\n",
+ "归并排序是一种稳定的排序方法。和选择排序一样,归并排序的性能不受输入数据的影响,但表现比选择排序好的多,因为始终都是O(nlogn)的时间复杂度。代价是需要额外的内存空间。"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1]\n",
+ "********************\n",
+ "[2]\n",
+ "____________________\n",
+ "result: [1, 2]\n",
+ "[4]\n",
+ "********************\n",
+ "[5]\n",
+ "____________________\n",
+ "result: [4, 5]\n",
+ "[3]\n",
+ "********************\n",
+ "[4, 5]\n",
+ "____________________\n",
+ "result: [3, 4, 5]\n",
+ "[1, 2]\n",
+ "********************\n",
+ "[3, 4, 5]\n",
+ "____________________\n",
+ "result: [1, 2, 3, 4, 5]\n",
+ "[7]\n",
+ "********************\n",
+ "[90]\n",
+ "____________________\n",
+ "result: [7, 90]\n",
+ "[6]\n",
+ "********************\n",
+ "[7, 90]\n",
+ "____________________\n",
+ "result: [6, 7, 90]\n",
+ "[23]\n",
+ "********************\n",
+ "[45]\n",
+ "____________________\n",
+ "result: [23, 45]\n",
+ "[21]\n",
+ "********************\n",
+ "[23, 45]\n",
+ "____________________\n",
+ "result: [21, 23, 45]\n",
+ "[6, 7, 90]\n",
+ "********************\n",
+ "[21, 23, 45]\n",
+ "____________________\n",
+ "result: [6, 7, 21, 23, 45, 90]\n",
+ "[1, 2, 3, 4, 5]\n",
+ "********************\n",
+ "[6, 7, 21, 23, 45, 90]\n",
+ "____________________\n",
+ "result: [1, 2, 3, 4, 5, 6, 7, 21, 23, 45, 90]\n",
+ "[1, 2, 3, 4, 5, 6, 7, 21, 23, 45, 90]\n"
+ ]
+ }
+ ],
+ "source": [
+ "def MergeSort(lists):\n",
+ " if len(lists) <= 1:\n",
+ " return lists\n",
+ " num = int(len(lists) / 2)\n",
+ " # 从中间,进行数据的拆分, 递归的返回数据进行迭代排序\n",
+ " left = MergeSort(lists[:num])\n",
+ " right = MergeSort(lists[num:])\n",
+ " print(left)\n",
+ " print(\"*\" * 20)\n",
+ " print(right)\n",
+ " print(\"_\" * 20)\n",
+ " return Merge(left, right)\n",
+ "\n",
+ "# 将 2 个已经排好序的子序列合并成一个序列,也就是 2-路归并\n",
+ "def Merge(left, right):\n",
+ " r, l = 0, 0\n",
+ " result = []\n",
+ " # 这里将两个序列中的每个值都比较一下,最小的放到最左边\n",
+ " while l < len(left) and r < len(right):\n",
+ " if left[l] < right[r]:\n",
+ " result.append(left[l])\n",
+ " l += 1\n",
+ " else:\n",
+ " result.append(right[r])\n",
+ " r += 1\n",
+ " result += right[r:]\n",
+ " result += left[l:]\n",
+ " print('result:', result)\n",
+ " # 最终将合并好的完整序列返回\n",
+ " return result\n",
+ "\n",
+ "\n",
+ "if __name__ == \"__main__\":\n",
+ " print(MergeSort([1, 2, 3, 4, 5, 6, 7, 90, 21, 23, 45]))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 7、基数排序\n",
+ "\n",
+ "### 7.1、简介\n",
+ "\n",
+ "以十进制为例,基数指的是数的位,如个位,十位百位等。而以十六进制为例,0xB2,就有两个radices(radix的复数)。\n",
+ "\n",
+ "基数排序是按照低位先排序,然后收集;再按照高位排序,然后再收集;依次类推,直到最高位。有时候有些属性是有优先级顺序的,先按低优先级排序,再按高优先级排序。最后的次序就是高优先级高的在前,高优先级相同的低优先级高的在前。\n",
+ "\n",
+ "### 7.2、算法描述\n",
+ "\n",
+ " - 取得数组中的最大数,并取得位数;\n",
+ " - arr 为原始数组,从最低位开始取每个位组成 radix 数组;\n",
+ " - 对 radix 进行计数排序(利用计数排序适用于小范围数的特点)\n",
+ " \n",
+ "**补充描述:**\n",
+ "\n",
+ "基数排序不同于其他的排序算法,它不是基于比较的算法。基数排序是一种借助多关键字排序的思想对单逻辑关键字进行排序的方法。它是一种稳定的排序算法。多关键字排序中有两种方法:最高位优先法(MSD)和最低位优先法(LSD)。通常用于对数的排序选择的是最低位优先法,即先对最次位关键字进行排序,再对高一位的关键字进行排序,以此类推。\n",
+ "\n",
+ "算法的思想:类似于桶式排序,我们需要给待排序记录准备10个桶,为什么是10个??因为一个数的任何一位上,其数字大小都位于0~9之间,因此采用10个桶,桶的编号分别为0,1,2,3,4...9,对应待排序记录中每个数相应位的数值,基数排序也是因此而得名。我们先根据待排序记录的每个数的个位来决定让其加入哪个桶中。例如:待排序数组为\n",
+ "\n",
+ "278 109 63 930 589 184 505 269 8 83\n",
+ "\n",
+ "求取每个数的个位数,依次为:8 9 3 0 9 4 5 9 8 3\n",
+ "\n",
+ "依照其个位数决定将其加入哪个桶中\n",
+ "\n",
+ "\n",
+ " \n",
+ "### 7.3、动图演示\n",
+ "\n",
+ "\n",
+ "\n",
+ "### 7.4、代码实现\n",
+ "\n",
+ "基数排序基于分别排序,分别收集,所以是稳定的。但基数排序的性能比桶排序要略差,每一次关键字的桶分配都需要 $O(n)$ 的时间复杂度,而且分配之后得到新的关键字序列又需要 $O(n)$ 的时间复杂度。假如待排数据可以分为 $d$ 个关键字,则基数排序的时间复杂度将是 $O(d*2n)$ ,当然 $d$ 要远远小于 $n$ ,因此基本上还是线性级别的。\n",
+ "\n",
+ "基数排序的空间复杂度为 $O(n+k)$ ,其中 $k$ 为桶的数量。一般来说 $n>>k$ ,因此额外空间需要大概 $n$ 个左右。"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[1, 2, 3, 5, 7, 9]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# ************************基数排序****************************\n",
+ "# 确定排序的次数\n",
+ "# 排序的顺序跟序列中最大数的位数相关\n",
+ "def radix_sort_nums(L):\n",
+ " maxNum = L[0]\n",
+ " #寻找序列中的最大数\n",
+ " for x in L:\n",
+ " if maxNum < x:\n",
+ " maxNum = x\n",
+ " # 确定序列中的最大元素的位数\n",
+ " times = 0\n",
+ " while (maxNum > 0):\n",
+ " maxNum = int((maxNum/10))\n",
+ " times += 1\n",
+ " return times\n",
+ "\n",
+ "# 找到num从低到高第pos位的数据\n",
+ "def get_num_pos(num, pos):\n",
+ " return (int((num/(10**(pos-1))))) % 10\n",
+ "\n",
+ "# 基数排序\n",
+ "def radix_sort(L):\n",
+ " count = 10 * [None] # 存放各个桶的数据统计个数\n",
+ " bucket = len(L) * [None] # 暂时存放排序结果\n",
+ " # 从低位到高位依次执行循环\n",
+ " for pos in range(1, radix_sort_nums(L)+1):\n",
+ " # 置空各个桶的数据统计\n",
+ " for x in range(0, 10):\n",
+ " count[x] = 0\n",
+ " # 统计当前该位(个位,十位,百位....)的元素数目\n",
+ " for x in range(0, len(L)):\n",
+ " # 统计各个桶将要装进去的元素个数\n",
+ " j = get_num_pos(int(L[x]), pos)\n",
+ " count[j] += 1\n",
+ " # count[i]表示第i个桶的右边界索引\n",
+ " for x in range(1,10):\n",
+ " count[x] += count[x-1]\n",
+ " # 将数据依次装入桶中\n",
+ " for x in range(len(L)-1, -1, -1):\n",
+ " # 求出元素第K位的数字\n",
+ " j = get_num_pos(L[x], pos)\n",
+ " # 放入对应的桶中,count[j]-1是第j个桶的右边界索引\n",
+ " bucket[count[j]-1] = L[x]\n",
+ " # 对应桶的装入数据索引-1\n",
+ " count[j] -= 1\n",
+ " # 将已分配好的桶中数据再倒出来,此时已是对应当前位数有序的表\n",
+ " for x in range(0, len(L)):\n",
+ " L[x] = bucket[x]\n",
+ " \n",
+ "if __name__ == \"__main__\":\n",
+ " l = [5, 1, 9, 3, 2, 7]\n",
+ " radix_sort(l)\n",
+ " print(l)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.6.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/docs/Algorithm/DataStructure/Python/Sort/insertionSort.py b/docs/Algorithm/DataStructure/Python/Sort/insertionSort.py
new file mode 100755
index 00000000..29f975d7
--- /dev/null
+++ b/docs/Algorithm/DataStructure/Python/Sort/insertionSort.py
@@ -0,0 +1,16 @@
+def insertionSort(nums):
+ if not nums or len(nums) < 2:
+ return nums
+
+ for i in range(1, len(nums)):
+ for j in range(i):
+ if nums[i] < nums[j]:
+ nums[i], nums[j] = nums[j], nums[i]
+ return nums
+
+
+if __name__ == "__main__":
+ nums = [5, 1, 9, 3, 2, 7]
+ print('input: ', nums)
+ nums = insertionSort(nums)
+ print("result: ", nums)
diff --git "a/docs/Algorithm/DataStructure/Python/Sort/\346\216\222\345\272\217\347\250\263\345\256\232\346\200\247.md" "b/docs/Algorithm/DataStructure/Python/Sort/\346\216\222\345\272\217\347\250\263\345\256\232\346\200\247.md"
new file mode 100755
index 00000000..08b1c964
--- /dev/null
+++ "b/docs/Algorithm/DataStructure/Python/Sort/\346\216\222\345\272\217\347\250\263\345\256\232\346\200\247.md"
@@ -0,0 +1 @@
+https://baike.baidu.com/item/%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95%E7%A8%B3%E5%AE%9A%E6%80%A7
diff --git a/docs/Algorithm/DataStructure/Python/Traversals/README.md b/docs/Algorithm/DataStructure/Python/Traversals/README.md
new file mode 100755
index 00000000..e69de29b
diff --git a/docs/Algorithm/DataStructure/README.md b/docs/Algorithm/DataStructure/README.md
deleted file mode 100644
index b4dade6a..00000000
--- a/docs/Algorithm/DataStructure/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-## 二分查找
-
-
-
-* 二分查找: [BinarySearch.py](/src/py3.x/DataStructure/BinarySearch.py)
-
-## 八大排序算法
-
-> Python 模版
-
-
-
-| 名称 | 动图 | 代码 |
-| --- | --- | --- |
-| 冒泡排序 |  | [BubbleSort.py](/src/py3.x/DataStructure/BubbleSort.py) |
-| 插入排序 |  | [InsertSort.py](/src/py3.x/DataStructure/InsertionSort.py) |
-| 选择排序 |  | [SelectionSort.py](/src/py3.x/DataStructure/SelectionSort.py) |
-| 快速排序 |  | [QuickSort.py](/src/py3.x/DataStructure/QuickSort.py) |
-| 希尔排序 |  | [ShellSort.py](/src/py3.x/DataStructure/ShellSort.py) |
-| 归并排序 |  | [MergeSort.py](/src/py3.x/DataStructure/MergeSort.py) |
-| 基数排序 |  | [RadixSort.py](/src/py3.x/DataStructure/RadixSort.py) |
-
-补充: [JavaScript 模块](https://github.com/apachecn/Interview/tree/master/docs/Algorithm/DataStructure/JavaScript.md)
diff --git a/docs/Algorithm/Leetcode/C++/0001._Two_Sum.md b/docs/Algorithm/Leetcode/C++/0001._Two_Sum.md
new file mode 100755
index 00000000..b693d4ad
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0001._Two_Sum.md
@@ -0,0 +1,74 @@
+# 1. Two Sum
+ **难度: Easy**
+ ## 刷题内容
+ > 原题连接
+ * https://leetcode.com/problems/two-sum
+* https://leetcode-cn.com/problems/two-sum/description
+ > 内容描述
+ ```
+给定 nums = [2, 7, 11, 15], target = 9
+ 因为 nums[0] + nums[1] = 2 + 7 = 9
+所以返回 [0, 1]
+```
+ ## 解题方案
+ > 思路 1
+******- 时间复杂度: O(NlgN)******- 空间复杂度: O(N)******
+ 采用双指针法,先将数组排序形成了一个有序的区间,指针i,j分别指向头尾,
+```
+当 nums1[i] + nums[j] > traget 时,j--,
+nums[i] + nums[j] < target 时,i++,
+直到 nums[i] + nums[j] == target
+```
+```cpp
+class Solution
+{
+public:
+ vector twoSum(vector& nums, int target)
+ {
+ vector > nums1;
+ for(int i = 0;i < nums.size();++i)
+ nums1.push_back(make_pair(nums[i],i));
+ sort(nums1.begin(),nums1.end());
+ int i = 0,j = nums1.size() - 1;
+ vector ret;
+ while(i < j)
+ {
+ if(nums1[i].first + nums1[j].first == target)
+ {
+ ret.push_back(nums1[i].second);
+ ret.push_back(nums1[j].second);
+ return ret;
+ }
+ nums1[i].first +nums1[j].first < target ? ++i : --j;
+ }
+ }
+};
+```
+> 思路 2
+******- 时间复杂度: O(N)******- 空间复杂度: O(N)******
+ c++中提供了 unordered_map 的容器,unordered_map 中的元素没有按照它们的键值或映射值的任何顺序排序,
+而是根据它们的散列值组织成桶以允许通过它们的键值直接快速访问单个元素(具有常数平均时间复杂度)
+将先出现的元素储存在 unorder_map 中,遍历数组,每次查找 target - nums[i] 是否存在即可。
+ ```cpp
+class Solution
+{
+public:
+ vector twoSum(vector& nums, int target)
+ {
+ unordered_map m;
+ vector res;
+ for (int i = 0; i < nums.size(); ++i) {
+ m[nums[i]] = i;
+ }
+ for (int i = 0; i < nums.size(); ++i) {
+ int t = target - nums[i];
+ if (m.count(t) && m[t] != i) {
+ res.push_back(i);
+ res.push_back(m[t]);
+ break;
+ }
+ }
+ return res;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0002._Add_Two_Numbers.md b/docs/Algorithm/Leetcode/C++/0002._Add_Two_Numbers.md
new file mode 100755
index 00000000..5e39962c
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0002._Add_Two_Numbers.md
@@ -0,0 +1,70 @@
+# 2. Add Two Numbers
+
+**难度:Medium**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/add-two-numbers/description/
+
+> 内容描述
+
+```
+给定两个链表代表两个非负数,求这两个数的和
+(2 -> 4 -> 3) + (5 -> 6 -> 4)
+因为 342 + 465 = 807
+所以返回 7 -> 0 -> 8
+```
+
+## 解题方案
+
+> 思路
+
+
+这题的的关键在于链表的数储存是倒序的,因此只要从链表头相加,再将所得数挨个储存即可,但是要注意两数相加有可能大于10要进一位。
+```cpp
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode(int x) : val(x), next(NULL) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
+ ListNode* current;
+ ListNode* ret = nullptr;
+ int num = 0;
+ while(l1 && l2)
+ {
+ int sum = l1 ->val + l2 ->val + num;
+ ListNode* node = new ListNode(sum % 10);
+ num = sum / 10;
+ ret ? current ->next = node : ret = node;
+ current = node;
+ l1 = l1 ->next;
+ l2 = l2 ->next;
+ }
+ if(l2)
+ l1 = l2;
+ while(l1)
+ {
+ int sum = num + l1 ->val;
+ ListNode* node = new ListNode(sum % 10);
+ num = sum / 10;
+ current ->next = node;
+ current = node;
+ l1 = l1 ->next;
+ }
+ if(num)
+ {
+ ListNode* node = new ListNode(num);
+ current ->next = node;
+ }
+ return ret;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0003._Longest_Substring_Without_Repeating_Characters.md b/docs/Algorithm/Leetcode/C++/0003._Longest_Substring_Without_Repeating_Characters.md
new file mode 100755
index 00000000..130d4cab
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0003._Longest_Substring_Without_Repeating_Characters.md
@@ -0,0 +1,97 @@
+# 3. Longest Substring Without Repeating Characters
+
+**难度:Medium**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/longest-substring-without-repeating-characters/description/
+
+> 内容描述
+
+```
+
+Given a string, find the length of the longest substring without repeating characters.
+
+Example 1:
+
+Input: "abcabcbb"
+Output: 3
+Explanation: The answer is "abc", with the length of 3.
+Example 2:
+
+Input: "bbbbb"
+Output: 1
+Explanation: The answer is "b", with the length of 1.
+Example 3:
+
+Input: "pwwkew"
+Output: 3
+Explanation: The answer is "wke", with the length of 3.
+ Note that the answer must be a substring, "pwke" is a subsequence and not a substring.
+```
+
+## 解题方案
+
+> 思路 1
+******- 时间复杂度: O(NlgN)******- 空间复杂度: O(N)******
+
+
+用 map储存 key为字符,value 为这个字符的位置,我们可以维护一个子字符串(无重复字符),记录它的起始位置,遍历 string s 当无法在map中找到字符或者小于子字符串的起始位置,就是没有在这个字符串中出现,反之则字符重复,不过 map查找为 O(lgn),因此总的时间复杂度为O(NlgN)
+```cpp
+class Solution {
+public:
+ int lengthOfLongestSubstring(string s) {
+ map m;
+ int beg = 0,length = s.length(),ll = 0,ans = 0;
+ for(int i = 0;i < length;++i)
+ {
+ if(m.find(s[i]) == m.end() || m[s[i]] < beg)
+ ll++;
+ else
+ {
+ int pos = m[s[i]];
+ ans = max(ll,ans);
+ ll = ll - (pos - beg);
+ beg = pos + 1;
+ }
+ m[s[i]] = i;
+ }
+ ans = max(ans,ll);
+ return ans;
+ }
+};
+```
+
+> 思路 2
+******- 时间复杂度: O(NlgN)******- 空间复杂度: O(1)******
+
+这个思路和上面差不多,用到了一个小窍门,因为储存的是字符,char为8位,因此能储存的最大数为256,这样空间复杂度就为O(1)
+
+```cpp
+class Solution {
+public:
+ int lengthOfLongestSubstring(string s) {
+ int m[256];
+ for(int i = 0;i < 256;++i)
+ m[i] = -1;
+ int beg = 0,length = s.length(),ll = 0,ans = 0;
+ for(int i = 0;i < length;++i)
+ {
+ if(m[s[i]] < beg)
+ ll++;
+ else
+ {
+ int pos = m[s[i]];
+ ans = max(ll,ans);
+ ll = ll - (pos - beg);
+ beg = pos + 1;
+ }
+ m[s[i]] = i;
+ }
+ ans = max(ans,ll);
+ return ans;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0004._Median_of_Two_Sorted_Arrays.md b/docs/Algorithm/Leetcode/C++/0004._Median_of_Two_Sorted_Arrays.md
new file mode 100755
index 00000000..9e8c456b
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0004._Median_of_Two_Sorted_Arrays.md
@@ -0,0 +1,159 @@
+# 004. Median of Two Sorted Arrays
+
+**难度Hard**
+
+## 刷题内容
+> 原题连接
+
+* https://leetcode.com/problems/median-of-two-sorted-arrays/submissions/
+
+> 内容描述
+
+```
+There are two sorted arrays nums1 and nums2 of size m and n respectively.
+
+Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).
+
+You may assume nums1 and nums2 cannot be both empty.
+
+Example 1:
+
+nums1 = [1, 3]
+nums2 = [2]
+
+The median is 2.0
+Example 2:
+
+nums1 = [1, 2]
+nums2 = [3, 4]
+
+The median is (2 + 3)/2 = 2.5
+```
+
+> 思路1
+******- 时间复杂度: O(n + m)******- 空间复杂度: O(1)******
+
+直接用暴利搜索,类似与归并两个有序的数组。遍历两个数组,当总长度等于(m+n)/ 2,注意区分总长度奇数和偶数
+```cpp
+class Solution {
+public:
+ double findMedianSortedArrays(vector& nums1, vector& nums2) {
+ int temp = (nums1.size() + nums2.size()) / 2,count1 = 0,i = 0,j = 0,current,pre;
+ while(i < nums1.size() && j < nums2.size() && count1 <= temp)
+ {
+ pre = current;
+ if(nums1[i] > nums2[j])
+ current = nums2[j++];
+ else
+ current = nums1[i++];
+ ++count1;
+ }
+ if(count1 <= temp)
+ {
+ if(i < nums1.size())
+ while(count1 <= temp)
+ {
+ pre = current;
+ current = nums1[i++];
+ ++count1;
+ }
+ else
+ while(count1 <= temp)
+ {
+ pre = current;
+ current = nums2[j++];
+ ++count1;
+ }
+ }
+ if((nums1.size() + nums2.size()) % 2)
+ return current;
+ double ans = (current + pre) / 2.0;
+ return ans;
+ }
+};
+```
+> 思路2
+******- 时间复杂度: O(lg(min(n.m)))******- 空间复杂度: O(1)******
+
+我们可以通过二分查找优化算法,利用中位数的定义,将两个数组划分为左右两个部分,nums1左半部分加nums2左半部分等于nums1右半部分加nums2的右半部分,如果总长度为偶数,那么nums1左半部分加nums2左半部分等于nums1右半部分加nums2的右半部分加1。并且```max(nums1[i],nums2[j]) <= max(nums1[i + 1],nums2[j + 1])```,接下来我们只要二分查找找i,并且要注意边界情况
+
+```cpp
+class Solution {
+public:
+ double findMedianSortedArrays(vector& nums1, vector& nums2) {
+ int m = nums1.size(),n = nums2.size(),sum = m + n;
+ if(!nums1.size())
+ return sum % 2 ? nums2[sum / 2] : (nums2[sum /2] + nums2[sum / 2 - 1]) / 2.0;
+ if(!nums2.size())
+ return sum % 2 ? nums1[sum / 2] : (nums1[sum /2] + nums1[sum / 2 - 1]) / 2.0;
+ if(m > n)
+ return findMedianSortedArrays(nums2,nums1);
+ int l = 0,r = m - 1;
+ while(l < r)
+ {
+ int mid = (l + r) / 2;
+ int j = (sum + 1) / 2 - mid - 2;
+ int min1 = max(nums1[mid],nums2[j]),max1 = min(nums1[mid + 1],nums2[j + 1]);
+ if(min1 <= max1)
+ return sum % 2 ? min1 : (min1 + max1) / 2.0;
+ else if(nums1[mid] > nums2[j])
+ r = mid - 1;
+ else
+ l = mid + 1;
+ }
+ int j = (sum + 1) / 2 - l - 2;
+ int min1,max1;
+ if(j < 0)
+ min1 = nums1[l];
+ else
+ min1 = max(nums1[l],nums2[j]);
+ if(l == nums1.size() - 1)
+ max1 = nums2[j + 1];
+ else
+ max1 = min(nums1[l + 1],nums2[j + 1]);
+ if(min1 <= max1)
+ return sum % 2 ? min1 : (min1 + max1) / 2.0;
+ j++;
+ if(j < nums2.size() - 1)
+ max1 = min(nums1[l],nums2[j + 1]);
+ else
+ max1 = nums1[l];
+ min1 = nums2[j];
+ return sum % 2 ? min1 : (min1 + max1) / 2.0;
+ }
+};
+```
+> 思路3
+******- 时间复杂度: O(lg(n+m))******- 空间复杂度: O(1)******
+
+由于题目中建议我们在时间复杂度O(lg(m+n))中完成,我们可以把这题看成寻找第k大的值,这样我们可以递归的去做,每次查找k/2,知道k等于1,注意边界值的处理
+```cpp
+class Solution {
+public:
+int getKth(vector nums1, int start1, int end1, vector nums2, int start2, int end2, int k) {
+ int len1 = end1 - start1 + 1;
+ int len2 = end2 - start2 + 1;
+ if (len1 > len2) return getKth(nums2, start2, end2, nums1, start1, end1, k);
+ if (len1 == 0) return nums2[start2 + k - 1];
+
+ if (k == 1) return min(nums1[start1], nums2[start2]);
+
+ int i = start1 + min(len1, k / 2) - 1;
+ int j = start2 + min(len2, k / 2) - 1;
+
+ if (nums1[i] > nums2[j]) {
+ return getKth(nums1, start1, end1, nums2, j + 1, end2, k - (j - start2 + 1));
+ }
+ else {
+ return getKth(nums1, i + 1, end1, nums2, start2, end2, k - (i - start1 + 1));
+ }
+ }
+double findMedianSortedArrays(vector nums1, vector nums2) {
+ int n = nums1.size();
+ int m = nums2.size();
+ int left = (n + m + 1) / 2;
+ int right = (n + m + 2) / 2;
+ return (getKth(nums1, 0, n - 1, nums2, 0, m - 1, left) + getKth(nums1, 0, n - 1, nums2, 0, m - 1, right)) * 0.5;
+}
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0005._Longest_Palindromic_Substring.md b/docs/Algorithm/Leetcode/C++/0005._Longest_Palindromic_Substring.md
new file mode 100755
index 00000000..dff587dc
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0005._Longest_Palindromic_Substring.md
@@ -0,0 +1,64 @@
+# 5. Longest Palindromic Substring
+
+**难度:Medium**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/longest-palindromic-substring/description/
+
+> 内容描述
+
+```
+Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
+
+Example 1:
+
+Input: "babad"
+Output: "bab"
+Note: "aba" is also a valid answer.
+Example 2:
+
+Input: "cbbd"
+Output: "bb"
+```
+
+## 解题方案
+
+> 思路 1
+******- 时间复杂度: O(N^2)******- 空间复杂度: O(N^2)******
+
+
+这题如果用单纯暴力的解法,时间复杂度为 O(n ^ 3),肯定超时,那么就要对这个算法进行优化,这里采用的是DP思想,定义 p(i,j)为s中的第i个数到s中的第j个数的子串,不难看出 p(i,j)中的子串有重复计算,接下来就可以写出状态转移方程 P(i,j)=(P(i+1,j?1) and S[i] == S[j])
+
+```cpp
+class Solution {
+public:
+ int dp[1000][1000] = {0};
+ string longestPalindrome(string s) {
+ int beg = 0,en = 1,ans = 0;
+ int length = s.length();
+ for(int i = 0;i < length;++i)
+ {
+ dp[i][i] = 1;
+ if(i + 1 < length && s[i] == s[i + 1])
+ dp[i][i + 1] = 1;
+ }
+ for(int i = 0;i < length;++i)
+ for(int j = 0;j <= i;++j)
+ {
+ if(i > j + 1)
+ dp[j][i] = (dp[j + 1][i - 1] && s[i] == s[j]);
+ if(dp[j][i] && i - j + 1 > ans)
+ {
+ ans = i - j + 1;
+ beg = j;
+ en = i + 1;
+ }
+ }
+ string ret(s.begin() + beg,s.begin() + en);
+ return ret;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0006._ZigZag _Conversion.md b/docs/Algorithm/Leetcode/C++/0006._ZigZag _Conversion.md
new file mode 100755
index 00000000..2338fc3d
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0006._ZigZag _Conversion.md
@@ -0,0 +1,96 @@
+# 6. ZigZag Conversion
+
+**难度:Medium**
+
+## 刷题内容
+
+> 原题连接
+
+*https://leetcode.com/problems/zigzag-conversion/description/
+*
+> 内容描述
+
+```
+The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
+
+P A H N
+A P L S I I G
+Y I R
+And then read line by line: "PAHNAPLSIIGYIR"
+
+Write the code that will take a string and make this conversion given a number of rows:
+
+string convert(string s, int numRows);
+Example 1:
+
+Input: s = "PAYPALISHIRING", numRows = 3
+Output: "PAHNAPLSIIGYIR"
+Example 2:
+
+Input: s = "PAYPALISHIRING", numRows = 4
+Output: "PINALSIGYAHRPI"
+Explanation:
+
+P I N
+A L S I G
+Y A H R
+P I
+```
+
+## 解题方案
+
+> 思路1
+******- 时间复杂度: O(N)******- 空间复杂度: O(N + numRows)******
+
+
+这道题理解了题目意思其实不难,一般人可能会开一个二维数组,然后就按题目意思储存,这样做的话时间复杂度和空间复杂度都比较大,这里我用的方法先用一个 string 类型变量 str ,resize 和输入的 s 长度相等,接着只要遍历找到 s[i] 在 str 中的位置即可
+
+
+```cpp
+class Solution {
+public:
+ string convert(string s, int numRows) {
+ string newStr;
+ if(!s.length() || numRows == 1)
+ return s;
+ newStr.resize(s.length());
+ int num = numRows * 2 - 2,col = s.length() / num,rem = (s.length() - 1) % num;
+ vector rowNum;
+ for(int i = 0;i < numRows;++i)
+ if(!i)
+ s.length() % num ? rowNum.push_back(col + 1) : rowNum.push_back(col);
+ else
+ {
+ if(i == numRows - 1)
+ rem >= i ? rowNum.push_back(rowNum[i - 1] + (s.length() - 1) / num + 1) : rowNum.push_back(rowNum[i - 1] + (s.length() - 1) / num);
+ else
+ {
+ int temp = 2 * numRows - i - 2,col1 = (s.length() - 1) / num;
+ if(rem >= temp)
+ rowNum.push_back(rowNum[i - 1] + (col1 + 1) * 2);
+ else if(rem >= i)
+ rowNum.push_back(rowNum[i - 1] + col1 * 2 + 1);
+ else
+ rowNum.push_back(rowNum[i - 1] + col1 * 2);
+ }
+ }
+ for(int i = 0;i < s.length();++i)
+ {
+ int index1 = i % num;
+ int index2 = i / num;
+ if(!index1)
+ newStr[index2] = s[i];
+ else if(index1 == numRows - 1)
+ newStr[index2 + rowNum[index1 - 1]] = s[i];
+ else if(index1 < numRows)
+ newStr[index2 * 2 + rowNum[index1 - 1]] = s[i];
+ else
+ {
+ int index3 = 2 * numRows - index1 - 2;
+ newStr[index2 * 2 + 1 + rowNum[index3 - 1]] = s[i];
+ }
+ }
+ return newStr;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0007._Reverse_Integer.md b/docs/Algorithm/Leetcode/C++/0007._Reverse_Integer.md
new file mode 100755
index 00000000..c11dccfb
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0007._Reverse_Integer.md
@@ -0,0 +1,50 @@
+# 7. Reverse Integer
+
+**Ѷ:Easy**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/reverse-integer/
+
+>
+
+```
+Given a 32-bit signed integer, reverse digits of an integer.
+
+Example 1:
+
+Input: 123
+Output: 321
+Example 2:
+
+Input: -123
+Output: -321
+Example 3:
+
+Input: 120
+Output: 21
+Note:
+Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [?231, 231 ? 1]. For the purpose of this problem, assume that your function returns 0 when the reversed integer overflows.
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(1)******
+
+һeasyĿμλҪעⳬintķΧ
+
+```cpp
+class Solution {
+public:
+ int reverse(int x) {
+ long long val = 0;
+ do
+ {
+ val = val * 10 + x % 10;
+ x /= 10;
+ } while (x);
+
+ return (val > INT_MAX || val < INT_MIN) ? 0 : val;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0008._String_to_Integer_(atoi).md b/docs/Algorithm/Leetcode/C++/0008._String_to_Integer_(atoi).md
new file mode 100755
index 00000000..006e4cb5
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0008._String_to_Integer_(atoi).md
@@ -0,0 +1,104 @@
+# 8. String to Integer (atoi)
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/string-to-integer-atoi/
+
+>
+
+```
+Implement atoi which converts a string to an integer.
+
+The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial plus or minus sign followed by as many numerical digits as possible, and interprets them as a numerical value.
+
+The string can contain additional characters after those that form the integral number, which are ignored and have no effect on the behavior of this function.
+
+If the first sequence of non-whitespace characters in str is not a valid integral number, or if no such sequence exists because either str is empty or it contains only whitespace characters, no conversion is performed.
+
+If no valid conversion could be performed, a zero value is returned.
+
+Note:
+
+Only the space character ' ' is considered as whitespace character.
+Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [?231, 231 ? 1]. If the numerical value is out of the range of representable values, INT_MAX (231 ? 1) or INT_MIN (?231) is returned.
+Example 1:
+
+Input: "42"
+Output: 42
+Example 2:
+
+Input: " -42"
+Output: -42
+Explanation: The first non-whitespace character is '-', which is the minus sign.
+ Then take as many numerical digits as possible, which gets 42.
+Example 3:
+
+Input: "4193 with words"
+Output: 4193
+Explanation: Conversion stops at digit '3' as the next character is not a numerical digit.
+Example 4:
+
+Input: "words and 987"
+Output: 0
+Explanation: The first non-whitespace character is 'w', which is not a numerical
+ digit or a +/- sign. Therefore no valid conversion could be performed.
+Example 5:
+
+Input: "-91283472332"
+Output: -2147483648
+Explanation: The number "-91283472332" is out of the range of a 32-bit signed integer.
+ Thefore INT_MIN (?231) is returned.
+```
+
+> ˼·
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(N)******
+
+һַתַֻֻ֣Ҫַתint͵ּɣģҪעֵ߽жֵΪЧʡȼ1032η10nηֵ
+
+```cpp
+class Solution {
+public:
+ int myAtoi(string str) {
+ int i = 0,count1 = 0;
+ long long arr[34];
+ arr[0] = 1;
+ for(int i = 1;i < 34;++i)
+ arr[i] = arr[i - 1] * 10;
+ while(str[i] == ' ')
+ i++;
+ if(str[i] == '-' || str[i] == '+')
+ {
+ if(str[i] == '-')
+ count1 = 1;
+ i++;
+ }
+ if(!isdigit(str[i]))
+ return 0;
+ while(str[i] == '0')
+ i++;
+ long long num = 0;
+ int j = i;
+ while(j < str.length() && isdigit(str[j]))
+ j++;
+ if(j - i > 33)
+ return count1 ? INT_MIN : INT_MAX;
+ j--;
+ int t = 0;
+ while(j >= i)
+ {
+ num += (str[j] - '0') * arr[t++];
+ if(!count1 && num > INT_MAX)
+ return INT_MAX;
+ if(count1 && num * -1 < INT_MIN)
+ return INT_MIN;
+ j--;
+ }
+ if(count1)
+ num *= -1;
+ return num;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0009._Palindrome_Number.md b/docs/Algorithm/Leetcode/C++/0009._Palindrome_Number.md
new file mode 100755
index 00000000..2547c8c6
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0009._Palindrome_Number.md
@@ -0,0 +1,102 @@
+# 9. Palindrome Number
+
+**难度:Medium**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/palindrome-number/description/
+*
+> 内容描述
+
+```
+Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.
+
+Example 1:
+
+Input: 121
+Output: true
+Example 2:
+
+Input: -121
+Output: false
+Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.
+Example 3:
+
+Input: 10
+Output: false
+Explanation: Reads 01 from right to left. Therefore it is not a palindrome.
+Follow up:
+
+Coud you solve it without converting the integer to a string?
+```
+
+## 解题方案
+
+> 思路1
+******- 时间复杂度: O(N)******- 空间复杂度: O(1)******
+
+
+这题的难度不大,由于是数字,判断回文只需要求出倒过来的数字,判断两者是否相等,不过要注意负数一定不是回文
+
+
+```cpp
+class Solution {
+public:
+ bool isPalindrome(int x) {
+ long long ret = 0;
+ int num = x;
+ if(x < 0)
+ return false;
+ while(num)
+ {
+ ret = 10 * ret + num % 10;
+ num /= 10;
+ }
+ if(ret == x)
+ return true;
+ return false;
+ }
+};
+```
+> 思路2
+******- 时间复杂度: O(N)******- 空间复杂度: O(1)******
+
+
+计算出数字的长度,用双指针法,一个指针指向头,另一个指向尾,相等就前一个指针加一,后一个指针减一,若不相等则返回 false
+
+
+```cpp
+class Solution {
+public:
+ bool isPalindrome(int x) {
+ if (x < 0)
+ return false;
+
+ int cnt = 0;
+ long fac = 1;
+ int div = INT_MAX;
+ while (div != 0) {
+ cnt++;
+ fac *= 10;
+ div = x/fac;
+ }
+
+ fac /= 10;
+ for (int i=0; i难度: Hard**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/regular-expression-matching/description/
+
+> 内容描述
+
+```
+Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.
+
+'.' Matches any single character.
+'*' Matches zero or more of the preceding element.
+The matching should cover the entire input string (not partial).
+
+Note:
+
+s could be empty and contains only lowercase letters a-z.
+p could be empty and contains only lowercase letters a-z, and characters like . or *.
+
+Example 1:
+
+Input:
+s = "aa"
+p = "a"
+Output: false
+Explanation: "a" does not match the entire string "aa".
+
+Example 2:
+
+Input:
+s = "aa"
+p = "a*"
+Output: true
+Explanation: '*' means zero or more of the precedeng element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".
+
+Example 3:
+
+Input:
+s = "ab"
+p = ".*"
+Output: true
+Explanation: ".*" means "zero or more (*) of any character (.)".
+
+Example 4:
+
+Input:
+s = "aab"
+p = "c*a*b"
+Output: true
+Explanation: c can be repeated 0 times, a can be repeated 1 time. Therefore it matches "aab".
+
+Example 5:
+
+Input:
+s = "mississippi"
+p = "mis*is*p*."
+Output: false
+```
+
+## 解题方案
+
+> 思路1
+******- 时间复杂度: O(n^2)******- 空间复杂度: O(n^2)******
+
+用动态规划的思路去解,dp[i][j]代表字符串s中第i个字符之前的字符串与p中第j个字符串之前的字符是否匹配。写出状态转移方程。当```s[i] == p[j] || p[j] == '.'```时。```dp[i + 1][j + 1] = dp[i][j]```。当```p[j] == '*'```时,可以匹配0个,1个或多个之前相同的字符。当之前的字符```s[i] == p[j - 1] || p[j - 1] == '*'```时。```dp[i + 1][j + 1] = dp[i][j] || dp[i][j + 1]```表示匹配1个或者多个。还可匹配0个。因此```dp[i + 1][j + 1] = dp[i + 1][j + 1] || dp[i + 1][j - 1]```
+
+```cpp
+class Solution {
+public:
+ bool isMatch(string s, string p) {
+ s.push_back(' ');
+ p.push_back(' ');
+ int len1 = s.length(),len2 = p.length();
+ int dp[len1 + 1][len2 + 1];
+ memset(dp,0,sizeof(dp));
+ dp[0][0] = 1;
+ for(int i = 1;i < len2;++i)
+ if(p[i] == '*')
+ dp[0][i + 1] = dp[0][i - 1];
+ for(int i = 0;i < len1;++i)
+ for(int j = 0;j < len2;++j)
+ if(j && p[j] == '*')
+ {
+ dp[i + 1][j + 1] = (p[j - 1] == s[i] || p[j - 1] == '.') && (dp[i][j] || dp[i][j + 1]);
+ dp[i + 1][j + 1] = dp[i + 1][j + 1] || dp[i + 1][j - 1];
+ }
+ else if(s[i] == p[j] || p[j] == '.')
+ dp[i + 1][j + 1] = dp[i][j];
+ return dp[len1][len2];
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0011._Container_With_Most_Water.md b/docs/Algorithm/Leetcode/C++/0011._Container_With_Most_Water.md
new file mode 100755
index 00000000..31679e93
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0011._Container_With_Most_Water.md
@@ -0,0 +1,41 @@
+# 11. container with most water
+
+**难度:Medium**
+
+## 刷题内容
+
+> 原题连接
+
+*https://leetcode.com/problems/container-with-most-water/
+*
+> 内容描述
+
+```
+Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.
+
+Note: You may not slant the container and n is at least 2.
+```
+
+## 解题方案
+
+> 思路
+******- 时间复杂度: O(N)******- 空间复杂度: O(1)******
+
+这道题刚开始很容易想到用暴力的方法去解,但是时间复杂度为 O(n^2) 测试之后发现是 TLE,那么我们就要对算法进行优化,这里我们用双指针法,定义两个指针,一个指向头,另一个指向尾部,比较两个指针指向的数的大小,若头部的大,则指向头部的指针向后移动一位,反之,则指向尾部的指针向前移动一位。
+
+
+```cpp
+class Solution {
+public:
+ int maxArea(vector& height) {
+ int i = 0,j = height.size() - 1,ans = INT_MIN;
+ while(i < j)
+ {
+ int t = min(height[i],height[j]);
+ ans = max(ans,t * (j - i));
+ height[i] < height[j] ? i++ : j--;
+ }
+ return ans;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0012._Integer_to_Roman.md b/docs/Algorithm/Leetcode/C++/0012._Integer_to_Roman.md
new file mode 100755
index 00000000..11ef18ee
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0012._Integer_to_Roman.md
@@ -0,0 +1,164 @@
+# 12. Integer to Roman
+
+**Ѷ:Medium**
+
+## ˢ
+
+> ԭ
+
+* https://leetcode.com/problems/rotate-list/
+
+>
+
+```
+Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
+
+Symbol Value
+I 1
+V 5
+X 10
+L 50
+C 100
+D 500
+M 1000
+For example, two is written as II in Roman numeral, just two one's added together. Twelve is written as, XII, which is simply X + II. The number twenty seven is written as XXVII, which is XX + V + II.
+
+Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:
+
+I can be placed before V (5) and X (10) to make 4 and 9.
+X can be placed before L (50) and C (100) to make 40 and 90.
+C can be placed before D (500) and M (1000) to make 400 and 900.
+Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999.
+
+Example 1:
+
+Input: 3
+Output: "III"
+Example 2:
+
+Input: 4
+Output: "IV"
+Example 3:
+
+Input: 9
+Output: "IX"
+Example 4:
+
+Input: 58
+Output: "LVIII"
+Explanation: L = 50, V = 5, III = 3.
+Example 5:
+
+Input: 1994
+Output: "MCMXCIV"
+Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
+
+```
+
+
+
+> ˼·1
+
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(n)******
+
+Ŀѣֱһֱд
+
+```cpp
+class Solution {
+public:
+ string intToRoman(int num) {
+ string ans;
+ vector table;
+ int a = 0;
+ int count = 0;
+ while(num){
+ a = num%10;
+ num /= 10;
+ ++count;
+ if(count==1){
+ if(a==1) table.push_back("I");
+ else if(a==2) table.push_back("II");
+ else if(a==3) table.push_back("III");
+ else if(a==4) table.push_back("IV");
+ else if(a==5) table.push_back("V");
+ else if(a==6) table.push_back("VI");
+ else if(a==7) table.push_back("VII");
+ else if(a==8) table.push_back("VIII");
+ else if(a==9) table.push_back("IX");
+ }
+ else if(count==2){
+ if(a==1) table.push_back("X");
+ else if(a==2) table.push_back("XX");
+ else if(a==3) table.push_back("XXX");
+ else if(a==4) table.push_back("XL");
+ else if(a==5) table.push_back("L");
+ else if(a==6) table.push_back("LX");
+ else if(a==7) table.push_back("LXX");
+ else if(a==8) table.push_back("LXXX");
+ else if(a==9) table.push_back("XC");
+ }
+ else if(count==3){
+ if(a==1) table.push_back("C");
+ else if(a==2) table.push_back("CC");
+ else if(a==3) table.push_back("CCC");
+ else if(a==4) table.push_back("CD");
+ else if(a==5) table.push_back("D");
+ else if(a==6) table.push_back("DC");
+ else if(a==7) table.push_back("DCC");
+ else if(a==8) table.push_back("DCCC");
+ else if(a==9) table.push_back("CM");
+ }
+ else if(count==4){
+ if(a==1) table.push_back("M");
+ else if(a==2) table.push_back("MM");
+ else if(a==3) table.push_back("MMM");
+ }
+ }
+ for(int i = table.size()-1; i >= 0; --i){
+ ans += table[i];
+ }
+ return ans;
+ }
+};
+```
+
+> ˼·2
+
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(1)******
+
+̫if elseIJÿǿԻһָŵдôÿ
+
+```cpp
+class Solution {
+public:
+ int arr[7] = {'I','V','X','L','C','D','M'};
+ int arr1[13] = {1,4,5,9,10,40,50,90,100,400,500,900,1000};
+ void f(int& num,int i,string& ans)
+ {
+ if(i % 2)
+ {
+ ans.push_back(arr[i / 4 * 2]);
+ ans.push_back(arr[i / 2 + 1]);
+ }
+ else
+ ans.push_back(arr[i / 2]);
+ num -= arr1[i];
+ }
+ string intToRoman(int num) {
+ string ans;
+ while(num)
+ {
+ int i;
+ for(i = 0;i < 13;++i)
+ if(num < arr1[i])
+ {
+ f(num,i - 1,ans);
+ break;
+ }
+ if(i == 13)
+ f(num,i - 1,ans);
+ }
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0014._Longest_Common_Prefix.md b/docs/Algorithm/Leetcode/C++/0014._Longest_Common_Prefix.md
new file mode 100755
index 00000000..7f4e57db
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0014._Longest_Common_Prefix.md
@@ -0,0 +1,58 @@
+# 14. Longest Common Prefix
+
+**Ѷ:Easy**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/longest-common-prefix/
+
+>
+
+```
+Write a function to find the longest common prefix string amongst an array of strings.
+
+If there is no common prefix, return an empty string "".
+
+Example 1:
+
+Input: ["flower","flow","flight"]
+Output: "fl"
+Example 2:
+
+Input: ["dog","racecar","car"]
+Output: ""
+Explanation: There is no common prefix among the input strings.
+Note:
+
+All given inputs are in lowercase letters a-z.
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n^2)******- ռ临Ӷ: O(1)******
+
+ǰӴֻбӴӴɣҪעܴڿַ
+
+```cpp
+class Solution {
+public:
+ string longestCommonPrefix(vector& strs) {
+ string temp;
+ if(!strs.size() || !strs[0].length())
+ return temp;
+ int j = 0;
+ while(1)
+ {
+ int i = 0;
+ int ch = strs[0][j];
+ for(;i < strs.size();++i)
+ if(j >= strs[i].length() || strs[i][j] != ch)
+ break;
+ if(i != strs.size())
+ break;
+ temp.push_back(strs[0][j++]);
+ }
+ return temp;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0015._3sum.md b/docs/Algorithm/Leetcode/C++/0015._3sum.md
new file mode 100755
index 00000000..e77e5ff4
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0015._3sum.md
@@ -0,0 +1,61 @@
+# 15. 3sum
+
+**难度:Medium**
+
+## 刷题内容
+
+> 原题连接
+
+*https://leetcode.com/problems/3sum/description/
+*
+> 内容描述
+
+```
+Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
+
+Note:
+
+The solution set must not contain duplicate triplets.
+```
+
+## 解题方案
+
+> 思路
+******- 时间复杂度: O(N ^ 2)******- 空间复杂度: O(N)******
+
+之前做过两个数之和等于某个数的题目,其实这题也差不多,三数之和等于0,那么我们只要让另外两个数之和等于第三个数的相反数即可,不过这里要注意会存在重复,所以要去重
+
+
+```cpp
+class Solution {
+public:
+ vector> threeSum(vector& nums) {
+ vector > ret;
+ sort(nums.begin(),nums.end());
+ for(int i = 0;i < nums.size();++i)
+ {
+ int t1 = i + 1,t2 = nums.size() - 1;
+ if(i && nums[i] == nums[i - 1])
+ continue;
+ while(t1 < t2)
+ if(nums[t1] + nums[t2] == -nums[i])
+ {
+ vector v;
+ v.push_back(nums[i]);
+ v.push_back(nums[t1]);
+ v.push_back(nums[t2]);
+ ret.push_back(v);
+ ++t1;
+ --t2;
+ }
+ else if(nums[t1] + nums[t2] < -nums[i])
+ ++t1;
+ else
+ --t2;
+ }
+ auto pos = unique(ret.begin(),ret.end());
+ ret.erase(pos,ret.end());
+ return ret;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0016._3Sum_Closest.md b/docs/Algorithm/Leetcode/C++/0016._3Sum_Closest.md
new file mode 100755
index 00000000..7cc1f3a0
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0016._3Sum_Closest.md
@@ -0,0 +1,45 @@
+## 16. 3Sum Closest
+
+难度:Medium
+
+## 内容
+
+> 原题链接:https://leetcode.com/problems/3sum-closest/description/
+
+Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution.
+
+Example:
+
+```
+Given array nums = [-1, 2, 1, -4], and target = 1.
+
+The sum that is closest to the target is 2. (-1 + 2 + 1 = 2).
+```
+
+## 思路
+
+先排序,遍历第一个数,第二和第三个数通过双指针查找,转化为2sum closest的问题。如果遇到和等于target的三个数,直接返回target。
+
+## 代码
+
+```
+class Solution {
+public:
+ int threeSumClosest(vector& nums, int target) {
+ std::sort(nums.begin(), nums.end());
+ int min_distance{INT_MAX}, sum{0}, cur_sum{0};
+ for (auto it = nums.cbegin(); it != nums.cend(); ++it)
+ for (auto left_idx = std::next(it), right_idx = std::prev(nums.cend()); left_idx < right_idx; cur_sum > target ? --right_idx : ++left_idx) {
+ cur_sum = *it + *left_idx + *right_idx;
+ auto cur_distance = std::abs(cur_sum - target);
+ if (cur_sum == target)
+ return target;
+ else if (cur_distance < min_distance) {
+ min_distance = cur_distance;
+ sum = cur_sum;
+ }
+ }
+ return sum;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0017._Letter_Combinations_of_a_Phone_Number.md b/docs/Algorithm/Leetcode/C++/0017._Letter_Combinations_of_a_Phone_Number.md
new file mode 100755
index 00000000..3b5763f2
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0017._Letter_Combinations_of_a_Phone_Number.md
@@ -0,0 +1,68 @@
+# 17. Letter Combinations of a Phone Number
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/letter-combinations-of-a-phone-number/
+
+>
+
+```
+Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.
+
+A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.
+
+
+
+Example:
+
+Input: "23"
+Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"].
+Note:
+
+Although the above answer is in lexicographical order, your answer could be in any order you want.
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(2^n)******- ռ临Ӷ: O(1)******
+
+ûݷȥ⣬Ƚַת֡79ֶ֮3ĸÿִĸûݷ
+
+```cpp
+class Solution {
+public:
+ void DFS(string& s,int i,vector& ans,string& temp)
+ {
+ if(i == s.length())
+ {
+ ans.push_back(temp);
+ return;
+ }
+ int t = s[i] - '2';
+ int ch_beg;
+ if(t < 6)
+ ch_beg = 'a' + t * 3;
+ else
+ ch_beg = 'a' + (t - 1) * 3 + 4;
+ int en = 3;
+ if(t == 5 || t == 7)
+ en = 4;
+ for(int j = 0;j < en;++j)
+ {
+ temp.push_back(ch_beg + j);
+ DFS(s,i + 1,ans,temp);
+ temp.pop_back();
+ }
+ }
+ vector letterCombinations(string digits) {
+ vector ans;
+ if(!digits.size())
+ return ans;
+ string temp;
+ DFS(digits,0,ans,temp);
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0018._4Sum.md b/docs/Algorithm/Leetcode/C++/0018._4Sum.md
new file mode 100755
index 00000000..0f30d24a
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0018._4Sum.md
@@ -0,0 +1,57 @@
+## 18. 4Sum
+
+难度:Medium
+
+## 内容
+
+题目链接:https://leetcode.com/problems/4sum/description/
+
+Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
+
+Note:
+
+The solution set must not contain duplicate quadruplets.
+
+Example:
+
+```
+Given array nums = [1, 0, -1, 0, -2, 2], and target = 0.
+
+A solution set is:
+[
+ [-1, 0, 0, 1],
+ [-2, -1, 1, 2],
+ [-2, 0, 0, 2]
+]
+```
+
+## 思路
+
+思路和 3Sum 类似,多了一层for循环。为了避免重复,在存储结果的时候使用STL的set。
+
+## 代码
+
+```
+class Solution {
+public:
+ vector> fourSum(vector& nums, int target) {
+ if (nums.size() < 4) return vector>{};
+ std::set> res;
+ std::sort(nums.begin(), nums.end());
+ for (size_t i = 0; i < nums.size() - 3; ++i)
+ for (size_t j = i + 1; j < nums.size() - 2; ++j) {
+ auto left_idx = j + 1; auto right_idx = nums.size() - 1;
+ int sum = 0;
+ for (left_idx = j + 1, right_idx = nums.size() - 1; left_idx < right_idx; sum > target ? --right_idx : ++left_idx) {
+ sum = nums[i] + nums[j] + nums[left_idx] + nums[right_idx];
+ if (sum == target) {
+ vector res_single{nums[i], nums[j], nums[left_idx], nums[right_idx]};
+ res.insert(res_single);
+ }
+
+ }
+ }
+ return vector>(res.begin(), res.end());
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0019._Remove_Nth_Node_From_End_of_List.md b/docs/Algorithm/Leetcode/C++/0019._Remove_Nth_Node_From_End_of_List.md
new file mode 100755
index 00000000..3d45103f
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0019._Remove_Nth_Node_From_End_of_List.md
@@ -0,0 +1,60 @@
+# 19. Remove Nth Node From End of List
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/remove-nth-node-from-end-of-list/
+
+>
+
+```
+Given a linked list, remove the n-th node from the end of list and return its head.
+
+Example:
+
+Given linked list: 1->2->3->4->5, and n = 2.
+
+After removing the second node from the end, the linked list becomes 1->2->3->5.
+```
+
+> ˼·
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(1)******
+
+ɾnΪ˷ֹΪ1ʱĿָ쳣ȲһͷֻҪȱܳȣܳȼȥ n ҪɾǰһͷijȣֻҪøѭҵɾҪɾĽڵ㼴ɡ
+
+```cpp
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode(int x) : val(x), next(NULL) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* removeNthFromEnd(ListNode* head, int n) {
+ ListNode* current = head;
+ int num = 0;
+ while(current)
+ {
+ num++;
+ current = current ->next;
+ }
+ ListNode* n1 = new ListNode(0);
+ n1 ->next = head;
+ current = n1;
+ num -= n;
+ while(num)
+ {
+ num--;
+ current = current ->next;
+ }
+ ListNode* temp = current ->next;
+ current ->next = temp ->next;
+ return n1 ->next;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0020._Valid_Parentheses.md b/docs/Algorithm/Leetcode/C++/0020._Valid_Parentheses.md
new file mode 100755
index 00000000..102c66ca
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0020._Valid_Parentheses.md
@@ -0,0 +1,55 @@
+## 20. Valid Parentheses
+ **难度: Easy**
+## 刷题内容
+> 原题连接
+* https://leetcode-cn.com/problems/valid-parentheses/
+> 内容描述
+```
+Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
+
+An input string is valid if:
+
+Open brackets must be closed by the same type of brackets.
+Open brackets must be closed in the correct order.
+Note that an empty string is also considered valid.
+
+### Example
+1. Input: "()" -> Output: true
+
+2. Input: "()[]{}" -> Output: true
+
+3. Input: "(]" -> Output: false
+
+4. Input: "([)]" -> Output: false
+
+5. Input: "{[]}" -> Output: true
+```
+## 解题方案
+> 思路:
+```
+利用栈先进后出的先天优势,解决匹配问题。
+```
+```cpp
+bool isValid(string s) {
+ stack stacks;
+ for(int i=0;i难度:Easy**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/merge-two-sorted-lists/description/
+*
+> 内容描述
+
+```
+Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
+
+Example:
+
+Input: 1->2->4, 1->3->4
+Output: 1->1->2->3->4->4
+```
+
+## 解题方案
+
+> 思路
+******- 时间复杂度: O(N + M)******- 空间复杂度: O(1)******
+
+首先这两个链表是排序好的,那么我们先定义一个空链表,再定义两个指针 i,j,按照顺序比较两个链表,如果 i 指向的数字小于 j指向的数字,i 指向的节点插入新链表中,i = i -> next,反之则操作 j。不过要注意其中一个链表可能会先结束,所以另一个未结束的链表直接插入新链表即可
+
+
+```cpp
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode(int x) : val(x), next(NULL) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
+ ListNode* h1 = l1;
+ ListNode* h2 = l2;
+ ListNode* t = new ListNode(0);
+ ListNode* curr = t;
+ while (h1 && h2)
+ {
+ if (h1->val <= h2->val) {
+ curr->next = h1;
+ h1 = h1->next;
+ }
+ else{
+ curr->next = h2;
+ h2 = h2->next;
+ }
+ curr = curr->next;
+ }
+ while (h1)
+ {
+ curr->next = h1;
+ h1 = h1->next;
+ curr = curr->next;
+ }
+ while(h2)
+ {
+ curr->next = h2;
+ h2 = h2->next;
+ curr = curr->next;
+ }
+ ListNode* res = t->next;
+ delete t;
+ return res;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0022._Generate_Parentheses.md b/docs/Algorithm/Leetcode/C++/0022._Generate_Parentheses.md
new file mode 100755
index 00000000..469322c3
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0022._Generate_Parentheses.md
@@ -0,0 +1,50 @@
+# 22. Generate Parentheses
+
+ **难度: Medium**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/generate-parentheses/
+
+ > 内容描述
+
+ ```
+给出 n 代表生成括号的对数,请你写出一个函数,使其能够生成所有可能的并且有效的括号组合。
+
+例如,给出 n = 3,生成结果为:
+
+[
+ "((()))",
+ "(()())",
+ "(())()",
+ "()(())",
+ "()()()"
+]
+ ```
+
+## 解题方案
+> 思路 1
+```
+回溯法
+```
+
+```cpp
+void dfs(int left, int total, string path, vector& ans){
+ if(total==0&&left==0){
+ ans.push_back(path);
+ return ;
+ }
+ if(left>0)
+ dfs(left-1, total-1, path+"(", ans);
+ if(left generateParenthesis(int n) {
+ vector ans;
+ string path="";
+ dfs(n, n*2, path, ans);
+ return ans;
+}
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0023._Merge_K_Sorted_Lists.md b/docs/Algorithm/Leetcode/C++/0023._Merge_K_Sorted_Lists.md
new file mode 100755
index 00000000..93dca868
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0023._Merge_K_Sorted_Lists.md
@@ -0,0 +1,125 @@
+# 23. merge k sorted lists
+
+**难度: Hard**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/merge-k-sorted-lists/
+
+> 内容描述
+
+```
+Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
+
+Example:
+
+Input:
+[
+ 1->4->5,
+ 1->3->4,
+ 2->6
+]
+Output: 1->1->2->3->4->4->5->6
+```
+
+## 解题方案
+
+> 思路1
+******- 时间复杂度: O(Nlg(K))******- 空间复杂度: O(K)******
+
+这里运用最小堆,先去每个链表的第一个元素构建最小堆,由于链表都是已排序的,因此,每次堆的顶部都是最小的元素,这里用优先队列实现最小堆。
+
+
+```cpp
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode(int x) : val(x), next(NULL) {}
+ * };
+ */
+class Solution {
+public:
+ struct cmp
+ {
+ bool operator()(ListNode* a, ListNode* b) const
+ {
+ return a ->val > b ->val;
+ }
+ };
+ ListNode* mergeKLists(vector& lists) {
+ priority_queue,cmp> pq;
+ ListNode* ret = nullptr;
+ ListNode* current = nullptr;
+ for(int i = 0;i < lists.size();++i)
+ if(lists[i])
+ pq.push(lists[i]);
+ while(pq.size())
+ {
+ ListNode* temp = pq.top();
+ pq.pop();
+ if(!ret)
+ ret = temp;
+ else
+ current ->next = temp;
+ current = temp;
+ if(temp ->next)
+ pq.push(temp ->next);
+ }
+ return ret;
+ }
+};
+```
+> 思路2
+******- 时间复杂度: O(Nlg(K))******- 空间复杂度: O(1)******
+
+这个思路用分治思想,我们可以通过归并排序解决,首先前面已经做过了两个有序链表的排序,我们可以把链表看做元素,只要对数组 Lists进行归并排序即可。
+
+```cpp
+class Solution {
+public:
+ ListNode* merge(ListNode* list1, ListNode* list2) {
+ ListNode head(0);
+ ListNode* tail = &head;
+ auto cur1 = list1;
+ auto cur2 = list2;
+ while (cur1 != nullptr && cur2 != nullptr) {
+ if (cur1->val < cur2->val) {
+ tail->next = cur1;
+ tail = tail->next;
+ cur1 = cur1->next;
+ } else {
+ tail->next = cur2;
+ tail = tail->next;
+ cur2 = cur2->next;
+ }
+ }
+ auto cur = cur1 == nullptr ? cur2 : cur1;
+ while (cur != nullptr) {
+ tail->next = cur;
+ tail = tail->next;
+ cur = cur->next;
+ }
+ return head.next;
+ }
+ ListNode* mergeSort(vector& lists, int start, int end) {
+ if (start > end) {
+ return nullptr;
+ }
+ if (start == end) {
+ return lists[start];
+ }
+ int mid = start + (end - start) / 2;
+ auto list1 = mergeSort(lists, start, mid);
+ auto list2 = mergeSort(lists, mid + 1, end);
+ return merge(list1, list2);
+ }
+ ListNode* mergeKLists(vector& lists) {
+ int n = lists.size();
+ return mergeSort(lists, 0, n - 1);
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0024._Swap_Nodes_in_Pairs.md b/docs/Algorithm/Leetcode/C++/0024._Swap_Nodes_in_Pairs.md
new file mode 100755
index 00000000..4e812ada
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0024._Swap_Nodes_in_Pairs.md
@@ -0,0 +1,53 @@
+# 24. Swap Nodes in Pairs
+
+ **难度: Medium**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/swap-nodes-in-pairs/
+
+ > 内容描述
+
+ ```
+给定一个链表,两两交换其中相邻的节点,并返回交换后的链表。
+
+示例:
+
+给定 1->2->3->4, 你应该返回 2->1->4->3.
+说明:
+
+你的算法只能使用常数的额外空间。
+你不能只是单纯的改变节点内部的值,而是需要实际的进行节点交换。
+ ```
+
+## 解题方案
+> 思路 1
+```
+链表反转
+```
+
+```cpp
+ListNode* swapPairs(ListNode* head) {
+ if(head==NULL||head->next==NULL)
+ return head;
+
+ ListNode* slow=head;
+ ListNode* fast=head->next;
+ ListNode* pre=new ListNode(0);
+ ListNode* ans = pre;
+ while(slow&&fast){
+ slow->next = fast->next;
+ fast->next = slow;
+ pre->next = fast;
+ if(slow->next==NULL||slow->next->next==NULL){
+ break;
+ }
+ fast = slow->next->next;
+ pre = slow;
+ slow = slow->next;
+ }
+ return ans->next;
+}
+```
diff --git a/docs/Algorithm/Leetcode/C++/0025._Reverse_Nodes_In_K_Group.md b/docs/Algorithm/Leetcode/C++/0025._Reverse_Nodes_In_K_Group.md
new file mode 100755
index 00000000..905c67aa
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0025._Reverse_Nodes_In_K_Group.md
@@ -0,0 +1,76 @@
+# 25.reverse nodes in k group
+
+**ѶHard**
+
+## ˢ
+
+> ԭ
+
+* https://leetcode.com/problems/reverse-nodes-in-k-group/
+
+>
+
+```
+Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
+
+k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.
+
+Example:
+
+Given this linked list: 1->2->3->4->5
+
+For k = 2, you should return: 2->1->4->3->5
+
+For k = 3, you should return: 3->2->1->4->5
+
+Note:
+
+Only constant extra memory is allowed.
+You may not alter the values in the list's nodes, only nodes itself may be changed.
+```
+> ˼·1
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(1)******
+
+Ŀѣ˵ݹķȥ⣬Ŀеnote˵жĴռ䣬ݹɸĿռ䣬ѵݹijѭ»ǵݹİ汾
+
+```cpp
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode(int x) : val(x), next(NULL) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* reverseKGroup(ListNode* head, int k) {
+ if(!head)
+ return head;
+ ListNode* current = head,*next1,*pre = nullptr;
+ int m = 1;
+ while(m <= k && current)
+ {
+ next1 = current ->next;
+ current ->next = pre;
+ pre = current;
+ current = next1;
+ ++m;
+ }
+ if(m <= k)
+ {
+ while(current != head)
+ {
+ ListNode* temp = pre ->next;
+ pre ->next = current;
+ current = pre;
+ pre = temp;
+ }
+ pre = head;
+ }
+ else
+ head ->next = reverseKGroup(current,k);
+ return pre;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0026._Remove_Duplicates_From_Sorted_Array.md b/docs/Algorithm/Leetcode/C++/0026._Remove_Duplicates_From_Sorted_Array.md
new file mode 100755
index 00000000..f03c9368
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0026._Remove_Duplicates_From_Sorted_Array.md
@@ -0,0 +1,71 @@
+# 26.Remove Duplicates From Sorted Array
+
+**ѶEasy**
+
+## ˢ
+
+> ԭ
+
+* https://leetcode.com/problems/remove-duplicates-from-sorted-array/
+>
+
+```
+Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.
+
+Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
+
+Example 1:
+
+Given nums = [1,1,2],
+
+Your function should return length = 2, with the first two elements of nums being 1 and 2 respectively.
+
+It doesn't matter what you leave beyond the returned length.
+Example 2:
+
+Given nums = [0,0,1,1,1,2,2,3,3,4],
+
+Your function should return length = 5, with the first five elements of nums being modified to 0, 1, 2, 3, and 4 respectively.
+
+It doesn't matter what values are set beyond the returned length.
+Clarification:
+
+Confused why the returned value is an integer but your answer is an array?
+
+Note that the input array is passed in by reference, which means modification to the input array will be known to the caller as well.
+
+Internally you can think of this:
+
+// nums is passed in by reference. (i.e., without making a copy)
+int len = removeDuplicates(nums);
+
+// any modification to nums in your function would be known by the caller.
+// using the length returned by your function, it prints the first len elements.
+for (int i = 0; i < len; i++) {
+ print(nums[i]);
+}
+```
+> ˼·
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(1)******
+
+Ѿõģֱӱ飬һָ i ָʼһ j ָڶ j ָ i ָ```++i,++j```ֻ```++j```
+
+```cpp
+class Solution {
+public:
+ int removeDuplicates(vector& nums) {
+ int j = 0;
+ if(!nums.size())
+ return 0;
+ for(int i = 1;i < nums.size();)
+ {
+ while(nums[j] == nums[i] && i < nums.size())
+ ++i;
+ if(i == nums.size())
+ break;
+ swap(nums[++j],nums[i++]);
+ }
+ return j + 1;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0027._Remove_Element.md b/docs/Algorithm/Leetcode/C++/0027._Remove_Element.md
new file mode 100755
index 00000000..50ec5f20
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0027._Remove_Element.md
@@ -0,0 +1,73 @@
+# 27.Remove Element
+
+**ѶEasy**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/remove-element/
+
+>
+
+```
+Given an array nums and a value val, remove all instances of that value in-place and return the new length.
+
+Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
+
+The order of elements can be changed. It doesn't matter what you leave beyond the new length.
+
+Example 1:
+
+Given nums = [3,2,2,3], val = 3,
+
+Your function should return length = 2, with the first two elements of nums being 2.
+
+It doesn't matter what you leave beyond the returned length.
+Example 2:
+
+Given nums = [0,1,2,2,3,0,4,2], val = 2,
+
+Your function should return length = 5, with the first five elements of nums containing 0, 1, 3, 0, and 4.
+
+Note that the order of those five elements can be arbitrary.
+
+It doesn't matter what values are set beyond the returned length.
+Clarification:
+
+Confused why the returned value is an integer but your answer is an array?
+
+Note that the input array is passed in by reference, which means modification to the input array will be known to the caller as well.
+
+Internally you can think of this:
+
+// nums is passed in by reference. (i.e., without making a copy)
+int len = removeElement(nums, val);
+
+// any modification to nums in your function would be known by the caller.
+// using the length returned by your function, it prints the first len elements.
+for (int i = 0; i < len; i++) {
+ print(nums[i]);
+}
+```
+> ˼·
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(1)******
+
+ǿԱ飬ѵ val ŵĺ벿־Сǿ˫ָʵ֡ nums[i] != val ʱnums[j++] = nums[i]
+```cpp
+class Solution {
+public:
+ int removeElement(vector& nums, int val) {
+ int i ,count = 0,j = 0,numsSize = nums.size();
+ for(i = 0;i < numsSize;i++)
+ {
+ if(nums[i] == val)
+ {
+ count++;
+ }
+ else
+ nums[j++] = nums[i];
+ }
+ return numsSize - count;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0028._Implement_Strstr.md b/docs/Algorithm/Leetcode/C++/0028._Implement_Strstr.md
new file mode 100755
index 00000000..2714a3a3
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0028._Implement_Strstr.md
@@ -0,0 +1,61 @@
+# 28.implement strstr
+
+**ѶEasy**
+
+## ˢ
+
+> ԭ
+
+* https://leetcode.com/problems/implement-strstr/
+>
+
+```
+Implement strStr().
+
+Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
+
+Example 1:
+
+Input: haystack = "hello", needle = "ll"
+Output: 2
+Example 2:
+
+Input: haystack = "aaaaa", needle = "bba"
+Output: -1
+Clarification:
+
+What should we return when needle is an empty string? This is a great question to ask during an interview.
+
+For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C's strstr() and Java's indexOf().
+```
+> ˼·
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(1)******
+
+ֱӱ haystack ƥ䵽 needle һַʱͱ needleȽַ
+
+```cpp
+class Solution {
+public:
+ int strStr(string haystack, string needle) {
+ int j = 0,i = 0,index= 0;
+ while(i < haystack.size() && j < needle.size())
+ {
+ if(haystack[i] == needle[j])
+ {
+ if(!j)
+ index = i;
+ j++;
+ i++;
+ }
+ else
+ {
+ i = ++index;
+ j = 0;
+ }
+ }
+ if(j == needle.size())
+ return index;
+ return -1;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0029._Divide_Two_Integers.md b/docs/Algorithm/Leetcode/C++/0029._Divide_Two_Integers.md
new file mode 100755
index 00000000..c1b82a47
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0029._Divide_Two_Integers.md
@@ -0,0 +1,80 @@
+# 29.divide two integers
+
+**ѶMedium**
+
+## ˢ
+
+> ԭ
+
+* https://leetcode.com/problems/divide-two-integers/
+>
+
+```
+Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.
+
+Return the quotient after dividing dividend by divisor.
+
+The integer division should truncate toward zero.
+
+Example 1:
+
+Input: dividend = 10, divisor = 3
+Output: 3
+Example 2:
+
+Input: dividend = 7, divisor = -3
+Output: -2
+Note:
+
+Both dividend and divisor will be 32-bit signed integers.
+The divisor will never be 0.
+Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [?231, 231 ? 1]. For the purpose of this problem, assume that your function returns 231 ? 1 when the division result overflows.
+
+```
+> ˼·
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(1)******
+
+ֱñķ϶ʱ˿ռ任ʱ䣬 int Ϊ2^31 - 1 ĴСҲǹ̶ġñȶһres = 0ÿζ res += divisor * 2^n ֱdividend ٴ res = divisor * 2^(n-1)ʼֱijres + divisor > dividend
+
+
+```cpp
+class Solution {
+public:
+ int divide(int dividend, int divisor) {
+ if(!dividend)
+ return 0;
+ long long arr[33];
+ arr[0] = 1;
+ for(int i = 1;i < 33;++i)
+ arr[i] = arr[i - 1] * 2;
+ long long temp1 = dividend,temp2 = divisor;
+ if(temp1 < 0)
+ temp1 *= -1;
+ if(temp2 < 0)
+ temp2 *= -1;
+ long long res,pre = 0,ret = 0;
+ int count1 = 0;
+ while(1)
+ {
+ res = pre + arr[count1] * temp2;
+ if(res > temp1)
+ {
+ if(!count1)
+ break;
+ pre = pre + arr[count1 - 1] * temp2;
+ ret += arr[count1 - 1];
+ count1 = 0;
+ }
+ else
+ count1++;
+ }
+ if(dividend < 0)
+ ret *= -1;
+ if(divisor < 0)
+ ret *= -1;
+ if(ret == 2147483648)
+ return ret - 1;
+ return ret;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0030._Substring_With_Concatenation_Of_All_Words.md b/docs/Algorithm/Leetcode/C++/0030._Substring_With_Concatenation_Of_All_Words.md
new file mode 100755
index 00000000..9bc3b6cf
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0030._Substring_With_Concatenation_Of_All_Words.md
@@ -0,0 +1,64 @@
+# 30.substring with concatenation of all words
+
+**难度Hard**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/substring-with-concatenation-of-all-words/
+
+> 内容描述
+
+```
+You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.
+
+Example 1:
+
+Input:
+ s = "barfoothefoobarman",
+ words = ["foo","bar"]
+Output: [0,9]
+Explanation: Substrings starting at index 0 and 9 are "barfoor" and "foobar" respectively.
+The output order does not matter, returning [9,0] is fine too.
+Example 2:
+
+Input:
+ s = "wordgoodstudentgoodword",
+ words = ["word","student"]
+Output: []
+
+```
+> 思路
+******- 时间复杂度: O(mlgn)******- 空间复杂度: O(m+n)******
+
+这题可以两个 map 来解决,第一个 map 中存放了 words 中的所有单词和出现的次数,接下来遍历字符串,固定区间的大小为 words 的长度,存入另一个map,两个 map 相等就放入返回数组中
+
+```cpp
+class Solution {
+public:
+ vector findSubstring(string s, vector& words) {
+ vector ans;
+ if(!s.length() || !words.size())
+ return ans;
+ unordered_map m1;
+ int len = words.size(),wl = words[0].length(),sl = s.length();
+ for(int i = 0;i < words.size();++i)
+ m1[words[i]]++;
+ int count1 = 0,reLen = wl * len,left = 0;
+ for(int i = 0;i < sl - wl * len + 1;++i)
+ {
+ unordered_map m2;
+ for(int j = 0,left = i;j < len;j ++)
+ {
+ string temp = s.substr(left,wl);
+ left += wl;
+ m2[temp]++;
+ }
+ if(m2 == m1)
+ ans.push_back(i);
+ }
+ return ans;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0031._Next_Permutatio.md b/docs/Algorithm/Leetcode/C++/0031._Next_Permutatio.md
new file mode 100755
index 00000000..1c5bf396
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0031._Next_Permutatio.md
@@ -0,0 +1,64 @@
+# 31.Next Permutatio
+
+**难度Medium**
+
+## 刷题内容
+> 原题连接
+
+* https://leetcode.com/problems/next-permutation/
+
+> 内容描述
+
+```
+Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
+
+If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).
+
+The replacement must be in-place and use only constant extra memory.
+
+Here are some examples. Inputs are in the left-hand column and its corresponding outputs are in the right-hand column.
+
+1,2,3 → 1,3,2
+3,2,1 → 1,2,3
+1,1,5 → 1,5,1
+```
+> 思路
+******- 时间复杂度: O(n)******- 空间复杂度: O(1)******
+
+我们可以用两个指针表示需要交换的两个数,遍历数组。这题的最坏的情况下,数组降序排列,排序算法的复杂度也是O(n)。
+
+```cpp
+class Solution {
+public:
+ void nextPermutation(vector& nums) {
+ int n1 = 0,n2 = 0;
+ for(int i = 1;i < nums.size();++i)
+ if(nums[i] > nums[n2])
+ {
+ n1 = n2;
+ n2 = i;
+ }
+ else if((nums[i] < nums[n2] && nums[i] > nums[n1]) || nums[i] == nums[n2])
+ n2 = i;
+ else if(nums[i] <= nums[n1])
+ {
+ int j = i;
+ for(;j < nums.size() - 1;++j)
+ if(nums[j + 1] > nums[j])
+ {
+ n1 = j;
+ n2 = j + 1;
+ break;
+ }
+ i = j + 1;
+ }
+ if(n1 == n2)
+ sort(nums.begin(),nums.end());
+ else
+ {
+ swap(nums[n1],nums[n2]);
+ sort(nums.begin() + n1 + 1,nums.end());
+ }
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0032._Longest_Valid_Parentheses.md b/docs/Algorithm/Leetcode/C++/0032._Longest_Valid_Parentheses.md
new file mode 100755
index 00000000..fe49d253
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0032._Longest_Valid_Parentheses.md
@@ -0,0 +1,57 @@
+# 32. Longest Valid Parentheses
+
+**Ѷ:Hard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/longest-valid-parentheses/
+
+>
+
+```
+Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
+
+Example 1:
+
+Input: "(()"
+Output: 2
+Explanation: The longest valid parentheses substring is "()"
+Example 2:
+
+Input: ")()())"
+Output: 4
+Explanation: The longest valid parentheses substring is "()()"
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(n)******
+
+DPķ⡣һջȥߵIJ֣'('λãֱһ')'ʱͼ¼ջ'('λãǾͿд״̬תƷ̡dp[i]ַеiԶλáһ')'ʱdp[i] = ջ'('λáڿԴţdp[dp[i] - 1]ڣdp[i] = dp[dp[i] - 1]Ҫע߽缴ɡ
+
+```cpp
+class Solution {
+public:
+ int longestValidParentheses(string s) {
+ int len = s.length();
+ if(!len)
+ return 0;
+ int dp[len];
+ memset(dp,-1,sizeof(dp));
+ int ans = 0;
+ vector v;
+ for(int i = 0;i < len;++i)
+ if(s[i] == '(')
+ v.push_back(i);
+ else if(s[i] == ')' && v.size())
+ {
+ dp[i] = v[v.size() - 1];
+ if(dp[i] && dp[dp[i] - 1] >= 0)
+ dp[i] = dp[dp[i] - 1];
+ ans = max(ans,i - dp[i] + 1);
+ v.pop_back();
+ }
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0033._Search_in_Rotated_Sorted_Array.md b/docs/Algorithm/Leetcode/C++/0033._Search_in_Rotated_Sorted_Array.md
new file mode 100755
index 00000000..e2cd5310
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0033._Search_in_Rotated_Sorted_Array.md
@@ -0,0 +1,80 @@
+# 033. Search in Rotated Sorted Array
+
+**难度Medium**
+
+## 刷题内容
+> 原题连接
+
+* https://leetcode.com/problems/search-in-rotated-sorted-array/
+
+> 内容描述
+
+```
+Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
+
+(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).
+
+You are given a target value to search. If found in the array return its index, otherwise return -1.
+
+You may assume no duplicate exists in the array.
+
+Your algorithm's runtime complexity must be in the order of O(log n).
+
+Example 1:
+
+Input: nums = [4,5,6,7,0,1,2], target = 0
+Output: 4
+Example 2:
+
+Input: nums = [4,5,6,7,0,1,2], target = 3
+Output: -1
+```
+> 思路1
+******- 时间复杂度: O(n)******- 空间复杂度: O(1)******
+
+第一个方法是直接遍历数组,找到返回数组下标,找不到就返回-1
+
+```cpp
+class Solution {
+public:
+ int search(vector& nums, int target) {
+ for(int i = 0;i < nums.size();++i)
+ if(nums[i] == target)
+ return i;
+ return -1;
+ }
+};
+```
+> 思路2
+******- 时间复杂度: O(lgn)*****- 空间复杂度: O(1)******
+
+第二个方法是用二分法找到旋转轴,再用二分法找到目标数
+```cpp
+class Solution {
+public:
+ int search(vector& nums, int target) {
+ int i = 0,j = nums.size() - 1;
+ if(!nums.size())
+ return -1;
+ while(i < j - 1)
+ {
+ int mid = (i + j) / 2;
+ if(nums[i] < nums[mid])
+ i = mid;
+ else
+ j = mid;
+ //cout << i << j << endl;
+ }
+ if(nums[i] <= nums[j])
+ j = i;
+ //cout << j;
+ auto pos = lower_bound(nums.begin(),nums.begin() + j,target);
+ if(pos != nums.end() && (*pos) == target)
+ return pos - nums.begin();
+ pos = lower_bound(nums.begin() + j,nums.end(),target);
+ if(pos != nums.end() && (*pos) == target)
+ return pos - nums.begin();
+ return -1;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0034._Find_First_and_Last_Position_of_Element_in_Sorted_Array.md b/docs/Algorithm/Leetcode/C++/0034._Find_First_and_Last_Position_of_Element_in_Sorted_Array.md
new file mode 100755
index 00000000..122f32c4
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0034._Find_First_and_Last_Position_of_Element_in_Sorted_Array.md
@@ -0,0 +1,105 @@
+# 34. Find First and Last Position of Element in Sorted Array
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/
+
+>
+
+```
+Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.
+
+Your algorithm's runtime complexity must be in the order of O(log n).
+
+If the target is not found in the array, return [-1, -1].
+
+Example 1:
+
+Input: nums = [5,7,7,8,8,10], target = 8
+Output: [3,4]
+Example 2:
+
+Input: nums = [5,7,7,8,8,10], target = 6
+Output: [-1,-1]
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(lgn)******- ռ临Ӷ: O(1)******
+
+͵ĶȲĿǷtargetڷֱҵһֵtargetһtarget
+
+```cpp
+class Solution {
+public:
+ vector searchRange(vector& nums, int target) {
+ int l = 0,r = nums.size();
+ vector ans = {-1,-1};
+ int mid = -1;
+ while(l < r)
+ {
+ mid = (r + l) / 2;
+ if(nums[mid] < target)
+ l = mid + 1;
+ else if(nums[mid] > target)
+ r = mid;
+ else
+ break;
+ }
+ if(mid == -1 || nums[mid] != target)
+ return ans;
+ int mid1 = l = mid;
+ r = nums.size();
+ while(l < r)
+ {
+ mid = (r + l) / 2;
+ if(mid == nums.size())
+ break;
+ if(nums[mid] > target)
+ r = mid;
+ else
+ l = mid + 1;
+ }
+ if(nums[mid] > target)
+ mid--;
+ ans[1] = mid;
+ l = 0;
+ r = mid1 + 1;
+ while(l < r)
+ {
+ mid = (r + l) / 2;
+ if(nums[mid] < target)
+ l = mid + 1;
+ else
+ r = mid;
+ }
+ if(nums[mid] < target)
+ mid++;
+ ans[0] = mid;
+ return ans;
+ }
+};
+```
+
+> ˼·2
+******- ʱ临Ӷ: O(lgn)******- ռ临Ӷ: O(1)******
+
+õc++lower_boundupper_bound
+
+```cpp
+class Solution {
+public:
+ vector searchRange(vector& nums, int target) {
+ auto pos1 = lower_bound(nums.begin(),nums.end(),target);
+ vector ans = {-1,-1};
+ if(pos1 == nums.end() || (*pos1) != target)
+ return ans;
+ ans[0] = pos1 - nums.begin();
+ auto pos2 = upper_bound(nums.begin(),nums.end(),target);
+ ans[1] = pos2 - nums.begin() - 1;
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0035._Search_Insert_Position.md b/docs/Algorithm/Leetcode/C++/0035._Search_Insert_Position.md
new file mode 100755
index 00000000..396e361d
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0035._Search_Insert_Position.md
@@ -0,0 +1,60 @@
+#35.search insert position
+
+**Ѷ:Easy**
+
+## ˢ
+
+> ԭ
+
+*https://leetcode.com/problems/search-insert-position/
+*
+>
+
+```
+Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
+
+You may assume no duplicates in the array.
+```
+> ˼·1
+******- ʱ临Ӷ: O(lgN)******- ռ临Ӷ: O(1)******
+
+Ѿõģһܵ͵Ķַ
+
+```cpp
+class Solution {
+public:
+ int searchInsert(vector& nums, int target) {
+ int first = 0,last = nums.size() - 1;
+ while(last > (first + 1))
+ {
+ int medium = (last + first) / 2;
+ if(nums[medium] == target)
+ return medium;
+ else if(nums[medium] < target)
+ first = medium;
+ else
+ last = medium;
+ }
+ if(target > nums[last])
+ return last + 1;
+ else if((target < nums[first]) || (target == nums[first]))
+ return first;
+ else
+ return last;
+ }
+};
+```
+> ˼·2
+******- ʱ临Ӷ: O(lgN)******- ռ临Ӷ: O(1)******
+
+ʵ˼·ҲǶַֻc++ѾǷװlower_boundֱӵü
+뿴ȥҲܶ
+```cpp
+class Solution {
+public:
+ int searchInsert(vector& nums, int target) {
+ auto pos = lower_bound(nums.begin(),nums.end(),target);
+ return pos - nums.begin();
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0036._Valid_Sudoku.md b/docs/Algorithm/Leetcode/C++/0036._Valid_Sudoku.md
new file mode 100755
index 00000000..9dec0351
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0036._Valid_Sudoku.md
@@ -0,0 +1,90 @@
+# 36. Valid Sudoku
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/valid-sudoku/
+
+>
+
+```
+Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:
+
+Each row must contain the digits 1-9 without repetition.
+Each column must contain the digits 1-9 without repetition.
+Each of the 9 3x3 sub-boxes of the grid must contain the digits 1-9 without repetition.
+A partially filled sudoku which is valid.
+
+The Sudoku board could be partially filled, where empty cells are filled with the character '.'.
+Example 1:
+
+Input:
+[
+ ["5","3",".",".","7",".",".",".","."],
+ ["6",".",".","1","9","5",".",".","."],
+ [".","9","8",".",".",".",".","6","."],
+ ["8",".",".",".","6",".",".",".","3"],
+ ["4",".",".","8",".","3",".",".","1"],
+ ["7",".",".",".","2",".",".",".","6"],
+ [".","6",".",".",".",".","2","8","."],
+ [".",".",".","4","1","9",".",".","5"],
+ [".",".",".",".","8",".",".","7","9"]
+]
+Output: true
+Example 2:
+
+Input:
+[
+ ["8","3",".",".","7",".",".",".","."],
+ ["6",".",".","1","9","5",".",".","."],
+ [".","9","8",".",".",".",".","6","."],
+ ["8",".",".",".","6",".",".",".","3"],
+ ["4",".",".","8",".","3",".",".","1"],
+ ["7",".",".",".","2",".",".",".","6"],
+ [".","6",".",".",".",".","2","8","."],
+ [".",".",".","4","1","9",".",".","5"],
+ [".",".",".",".","8",".",".","7","9"]
+]
+Output: false
+Explanation: Same as Example 1, except with the 5 in the top left corner being
+ modified to 8. Since there are two 8's in the top left 3x3 sub-box, it is invalid.
+Note:
+
+A Sudoku board (partially filled) could be valid but is not necessarily solvable.
+Only the filled cells need to be validated according to the mentioned rules.
+The given board contain only digits 1-9 and the character '.'.
+The given board size is always 9x9.
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n^2)******- ռ临Ӷ: O(1)******
+
+board9x9ģʵʵʱ临ӶҲ9x9ġֻҪֱжÿÿкÿ9СǷظɡѶȲ
+
+
+```cpp
+class Solution {
+public:
+ bool isValidSudoku(vector>& board) {
+ int arr[9][9];
+ int arr1[9][9];
+ int arr2[9][9];
+ memset(arr,0,sizeof(arr));
+ memset(arr2,0,sizeof(arr1));
+ memset(arr1,0,sizeof(arr1));
+ for(int i = 0;i < 9;++i)
+ for(int j = 0;j < 9;++j)
+ if(board[i][j] != '.')
+ {
+ if(arr[i][board[i][j] - '1'] || arr1[j][board[i][j] -'1'] || arr2[3 * (i / 3) + (j / 3)][board[i][j] -'1'])
+ return 0;
+ arr[i][board[i][j] - '1'] = 1;
+ arr1[j][board[i][j] -'1'] = 1;
+ arr2[3 * (i / 3) + (j / 3)][board[i][j] -'1'] = 1;
+ }
+ return 1;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0038._Count_and_Say.md b/docs/Algorithm/Leetcode/C++/0038._Count_and_Say.md
new file mode 100755
index 00000000..064f7fbb
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0038._Count_and_Say.md
@@ -0,0 +1,69 @@
+# 38. Count and Say
+
+**Ѷ:Easy**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/count-and-say/
+
+>
+
+```
+The count-and-say sequence is the sequence of integers with the first five terms as following:
+
+1. 1
+2. 11
+3. 21
+4. 1211
+5. 111221
+1 is read off as "one 1" or 11.
+11 is read off as "two 1s" or 21.
+21 is read off as "one 2, then one 1" or 1211.
+
+Given an integer n where 1 n 30, generate the nth term of the count-and-say sequence.
+
+Note: Each term of the sequence of integers will be represented as a string.
+
+
+Example 1:
+
+Input: 1
+Output: "1"
+Example 2:
+
+Input: 4
+Output: "1211"
+```
+
+> ˼·
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(1)******
+
+ҪŪĿ˼n == 1ʱ1һ1 one 1n == 2ʱǡ1121 two 1n == 3ʱǡ211211 one 2 one 1n == 4ʱǡ1211ƣдѭģIJɡ
+
+```cpp
+class Solution {
+public:
+ string countAndSay(int n) {
+ string str;
+ str.push_back('0' + 1);
+ n--;
+ while(n)
+ {
+ string temp;
+ for(int i = 0;i < str.length();)
+ {
+ int j = 0;
+ while(i + j < str.length() && str[i] == str[j + i])
+ ++j;
+ temp.push_back('0' + j);
+ temp.push_back(str[i]);
+ i += j;
+ }
+ --n;
+ str = temp;
+ }
+ return str;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0039._Combination_Sum.md b/docs/Algorithm/Leetcode/C++/0039._Combination_Sum.md
new file mode 100755
index 00000000..37226b70
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0039._Combination_Sum.md
@@ -0,0 +1,69 @@
+# 39. Combination Sum
+
+ **难度: Middle**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/combination-sum/
+
+ > 内容描述
+
+ ```
+给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。
+
+candidates 中的数字可以无限制重复被选取。
+
+说明:
+
+所有数字(包括 target)都是正整数。
+解集不能包含重复的组合。
+示例 1:
+
+输入: candidates = [2,3,6,7], target = 7,
+所求解集为:
+[
+ [7],
+ [2,2,3]
+]
+示例 2:
+
+输入: candidates = [2,3,5], target = 8,
+所求解集为:
+[
+ [2,2,2,2],
+ [2,3,3],
+ [3,5]
+]
+ ```
+
+## 解题方案
+> 思路 1
+```
+回溯
+```
+
+```cpp
+void dfs(vector& candidates, int target, int index, vector& path, vector>& ans){
+ if(target<0)
+ return ;
+ if(target == 0){
+ ans.push_back(path);
+ return ;
+ }
+ for(int i=index;i> combinationSum(vector& candidates, int target) {
+ sort(candidates.begin(), candidates.end());
+ vector> ans;
+ vector path;
+ dfs(candidates, target, 0, path, ans);
+ return ans;
+}
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0040._Combination_Sum_II.md b/docs/Algorithm/Leetcode/C++/0040._Combination_Sum_II.md
new file mode 100755
index 00000000..f837be35
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0040._Combination_Sum_II.md
@@ -0,0 +1,70 @@
+# 40. Combination Sum II
+
+ **难度: Medium**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/combination-sum-ii/
+
+ > 内容描述
+
+ ```
+给定一个数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。
+
+candidates 中的每个数字在每个组合中只能使用一次。
+
+说明:
+
+所有数字(包括目标数)都是正整数。
+解集不能包含重复的组合。
+示例 1:
+
+输入: candidates = [10,1,2,7,6,1,5], target = 8,
+所求解集为:
+[
+ [1, 7],
+ [1, 2, 5],
+ [2, 6],
+ [1, 1, 6]
+]
+示例 2:
+
+输入: candidates = [2,5,2,1,2], target = 5,
+所求解集为:
+[
+ [1,2,2],
+ [5]
+]
+ ```
+
+## 解题方案
+> 思路 1
+```
+回溯
+```
+
+```cpp
+void dfs(vector& candidates, int target, int index, vector& path, vector>& ans){
+ if(target<0)
+ return ;
+ if(target == 0){
+ ans.push_back(path);
+ return ;
+ }
+ for(int i=index;i index && candidates[i] == candidates[i - 1]) continue;
+ path.push_back(candidates[i]);
+ dfs(candidates, target-candidates[i], i+1, path, ans);
+ path.pop_back();
+ }
+}
+vector> combinationSum2(vector& candidates, int target) {
+ vector> ans;
+ vector path;
+ sort(candidates.begin(), candidates.end());
+ dfs(candidates, target, 0, path, ans);
+ return ans;
+}
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0041._First_Missing_Positive.md b/docs/Algorithm/Leetcode/C++/0041._First_Missing_Positive.md
new file mode 100755
index 00000000..9daeed7e
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0041._First_Missing_Positive.md
@@ -0,0 +1,52 @@
+# 041.First Missing Positive
+
+**ѶHard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/first-missing-positive/
+
+>
+
+```
+Given an unsorted integer array, find the smallest missing positive integer.
+
+Example 1:
+
+Input: [1,2,0]
+Output: 3
+Example 2:
+
+Input: [3,4,-1,1]
+Output: 2
+Example 3:
+
+Input: [7,8,9,11,12]
+Output: 1
+```
+> ˼·
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(1)******
+
+տʼĿ˼ˣ֮ACˡʵĴռ䣬Ӧû뵽ֱ hash УǿԱ飬1ĵһ12ڣĵڶλӣ
+
+```cpp
+class Solution {
+public:
+ int firstMissingPositive(vector& nums) {
+ if(!nums.size())
+ return 1;
+ for(int i = 0;i < nums.size();)
+ {
+ if(nums[i] < nums.size() && nums[i] != nums[nums[i] - 1])
+ swap(nums[i],nums[nums[i] - 1]);
+ else
+ ++i;
+ }
+ for(int i = 0;i < nums.size();++i)
+ if(nums[i] != i + 1)
+ return i + 1;
+ return nums.size() + 1;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0042._Trapping_Rain_Water.md b/docs/Algorithm/Leetcode/C++/0042._Trapping_Rain_Water.md
new file mode 100755
index 00000000..fe712f71
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0042._Trapping_Rain_Water.md
@@ -0,0 +1,56 @@
+# 42. Trapping Rain Water
+
+**ѶHard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/trapping-rain-water/
+
+>
+
+```
+Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
+
+Example:
+
+Input: [0,1,0,2,1,0,1,3,2,1,2,1]
+Output: 6
+```
+
+¼ l = 0飬 height[i] < height[l],˵λˮ¼ˮ height[i] >= height[l]˵[i,l]ڿԻˮȻȥˮǻˮ֮ l != height.size() - 1飬衣
+> ˼·
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(1)******
+
+```cpp
+class Solution {
+public:
+ int trap(vector& height) {
+ int l = 0,sum1 = 0,water = 0,i;
+ for(i = 1;i < height.size();++i)
+ if(height[i] >= height[l])
+ {
+ water = water + height[l] * (i - l - 1) - sum1;
+ l = i;
+ sum1 = 0;
+ }
+ else
+ sum1 += height[i];
+ if(l != (height.size() - 1))
+ {
+ int temp = l;
+ sum1 = 0;
+ for(i = height.size() - 2,l = height.size() - 1;i >= temp;--i)
+ if(height[i] >= height[l])
+ {
+ water = water + height[l] * (l- i - 1) - sum1;
+ l = i;
+ sum1 = 0;
+ }
+ else
+ sum1 += height[i];
+ }
+ return water;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0043._Multiply_Strings.md b/docs/Algorithm/Leetcode/C++/0043._Multiply_Strings.md
new file mode 100755
index 00000000..50aee87d
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0043._Multiply_Strings.md
@@ -0,0 +1,74 @@
+# 43. Multiply Strings
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/multiply-strings/
+
+>
+
+```
+Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.
+
+Example 1:
+
+Input: num1 = "2", num2 = "3"
+Output: "6"
+Example 2:
+
+Input: num1 = "123", num2 = "456"
+Output: "56088"
+Note:
+
+The length of both num1 and num2 is < 110.
+Both num1 and num2 contain only digits 0-9.
+Both num1 and num2 do not contain any leading zero, except the number 0 itself.
+You must not use any built-in BigInteger library or convert the inputs to integer directly.
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n^2)******- ռ临Ӷ: O(1)******
+
+ֱȽϴlong longֵ˲ת֣ģֵij˷ÿһλ¼һַС
+
+```cpp
+class Solution {
+public:
+ string multiply(string num1, string num2) {
+ string ans;
+ int d[120][120];
+ memset(d,0,sizeof(d));
+ for(int i = num2.size() - 1;i >= 0;--i)
+ {
+ int count1 = 0;
+ for(int j = num1.size()- 1;j >= 0;--j)
+ {
+ int pro_ans = (num1[j] - '0') * (num2[i] - '0');
+ d[num2.size() - 1 - i][num1.size() - j - 1] = pro_ans % 10 + count1;
+ count1 = pro_ans / 10;
+ if(d[num2.size() - 1 - i][num1.size() - j - 1] >= 10)
+ {
+ count1++;
+ d[num2.size() - 1 - i][num1.size() - j - 1] %= 10;
+ }
+ }
+ d[num2.size() - 1 - i][num1.size()] = count1;
+ }
+ int count1 = 0;
+ for(int j = 0;j < num1.size() + num2.size();++j)
+ {
+ for(int i = 0;i <= num2.size();++i)
+ if(j - i >= 0 && j - i <= num1.size())
+ count1 += d[i][j - i];
+ ans.push_back(count1 % 10 + '0');
+ count1 /= 10;
+ }
+ while(ans.length() > 1 && ans[ans.length() - 1] == '0')
+ ans.pop_back();
+ reverse(ans.begin(),ans.end());
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0044._Wildcard_Matching.md b/docs/Algorithm/Leetcode/C++/0044._Wildcard_Matching.md
new file mode 100755
index 00000000..86a0eecb
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0044._Wildcard_Matching.md
@@ -0,0 +1,98 @@
+# 44. Wildcard Matching
+
+**Ѷ:Hard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/wildcard-matching/
+
+>
+
+```
+Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'.
+
+'?' Matches any single character.
+'*' Matches any sequence of characters (including the empty sequence).
+The matching should cover the entire input string (not partial).
+
+Note:
+
+s could be empty and contains only lowercase letters a-z.
+p could be empty and contains only lowercase letters a-z, and characters like ? or *.
+Example 1:
+
+Input:
+s = "aa"
+p = "a"
+Output: false
+Explanation: "a" does not match the entire string "aa".
+Example 2:
+
+Input:
+s = "aa"
+p = "*"
+Output: true
+Explanation: '*' matches any sequence.
+Example 3:
+
+Input:
+s = "cb"
+p = "?a"
+Output: false
+Explanation: '?' matches 'c', but the second letter is 'a', which does not match 'b'.
+Example 4:
+
+Input:
+s = "adceb"
+p = "*a*b"
+Output: true
+Explanation: The first '*' matches the empty sequence, while the second '*' matches the substring "dce".
+Example 5:
+
+Input:
+s = "acdcb"
+p = "a*c?b"
+Output: false
+```
+
+> ˼·
+******- ʱ临Ӷ: O(n^2)******- ռ临Ӷ: O(n^2)******
+
+տʼʱΪһģ⣬ʱŷֿDPʹDPʱҵ״̬תƷ̡Ƕdp[i][j]ʾַ p е i - 1ĸ֮ǰַַ s еĵ j - 1ĸ֮ǰӴƥ䣬ǾͿдӦ״̬תƷ̵p[i] == '?'p[i] == s[j]ʱdp[i + 1][j + 1] = dp[i][j],p[i] == '*'ʱj < p.length(),dp[i + 1][j + 1] = dp[i][j],dp[i + 1][j] = dp[i][j],dp[p.length()][s.length() - 1]
+
+```cpp
+class Solution {
+public:
+ bool isMatch(string s, string p) {
+ if(!p.length())
+ return !s.length();
+ s.push_back(' ');
+ int dp[p.length() + 1][s.length() + 1];
+ for(int i =0;i <= p.length();++i)
+ for(int j = 0;j <= s.length();++j)
+ dp[i][j] = 0;
+
+ int count1 = 1;
+ dp[0][0] = 1;
+ for(int i = 0;i < p.length();++i)
+ {
+ for(int j = 0;j < s.length();++j)
+ if(p[i] == '?' || p[i] == s[j])
+ dp[i + 1][j + 1] = dp[i][j];
+ else if(p[i] == '*' && dp[i][j])
+ {
+ dp[i + 1][j + 1] = 1;
+ dp[i + 1][j] = 1;
+ ++j;
+ while(j < s.length())
+ {
+ dp[i + 1][j + 1] = 1;
+ ++j;
+ }
+ }
+ }
+ return dp[p.length()][s.length() - 1];
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0045._Jump_Game_II.md b/docs/Algorithm/Leetcode/C++/0045._Jump_Game_II.md
new file mode 100755
index 00000000..04807a4b
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0045._Jump_Game_II.md
@@ -0,0 +1,54 @@
+# 045. Jump Game II
+
+**ѶHard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/jump-game-ii/
+
+>
+
+```
+Given an array of non-negative integers, you are initially positioned at the first index of the array.
+
+Each element in the array represents your maximum jump length at that position.
+
+Your goal is to reach the last index in the minimum number of jumps.
+
+Example:
+
+Input: [2,3,1,1,4]
+Output: 2
+Explanation: The minimum number of jumps to reach the last index is 2.
+ Jump 1 step from index 0 to 1, then 3 steps to the last index.
+```
+
+> ˼·
+******- ʱ临Ӷ: O(n)*****- ռ临Ӷ: O(1)******
+
+տʼ뵽ʹö̬滮ʱ临ӶΪO(n)TLEˣʵO(n)ʱ临Ӷɵġ飬ÿζߵnums[i]ķΧߵԶľ롣¼ans
+```cpp
+class Solution {
+public:
+ int jump(vector& nums) {
+ int i = 0,length = nums.size(),next = nums[0],ans = 0;
+ if(length < 2)
+ return 0;
+ while(i < length)
+ {
+ ++ans;
+ if(next >= length - 1)
+ return ans;
+ int current = i;
+ for(int j = current+1;j <= min(next,length - 1);++j)
+ {
+ i = max(i,nums[j] + j);
+ cout << i << " ";
+ }
+ swap(i,next);
+ cout << i << " "<< next << endl;
+ }
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0046._Permutations.md b/docs/Algorithm/Leetcode/C++/0046._Permutations.md
new file mode 100755
index 00000000..b9b9c225
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0046._Permutations.md
@@ -0,0 +1,99 @@
+# 46. Permutations
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/permutations/
+
+>
+
+```
+Given a collection of distinct integers, return all possible permutations.
+
+Example:
+
+Input: [1,2,3]
+Output:
+[
+ [1,2,3],
+ [1,3,2],
+ [2,1,3],
+ [2,3,1],
+ [3,1,2],
+ [3,2,1]
+]
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n!*n)******- ռ临Ӷ: O(n)******
+
+ܲĿݹһ⣬ÿζһ֮ɡ
+
+```cpp
+class Solution {
+public:
+ vector> permute(vector& nums) {
+ vector > ans;
+ if(!nums.size())
+ return ans;
+ if(nums.size() == 1)
+ ans.push_back(nums);
+ for(int i = 0;i < nums.size();++i)
+ {
+ swap(nums[0],nums[i]);
+ vector v(nums.begin() + 1,nums.end());
+ vector > ret = permute(v);
+ for(int i = 0;i < ret.size();++i)
+ {
+ ret[i].push_back(nums[0]);
+ ans.push_back(ret[i]);
+ }
+ swap(nums[0],nums[i]);
+ }
+ return ans;
+ }
+};
+```
+> ˼·2
+******- ʱ临Ӷ: O(n!)******- ռ临Ӷ: O(n)******
+
+ǿԶ㷨ŻDFSķÿμ¼Ѿֽеݹ鼴
+
+```cpp
+class Solution {
+public:
+void DFS(int* visited,vector& nums,vector >& ans,vector temp)
+{
+ int count1 = 0;
+ for(int i = 0;i < nums.size();++i)
+ if(!visited[i])
+ {
+ temp.push_back(nums[i]);
+ visited[i] = 1;
+ DFS(visited,nums,ans,temp);
+ temp.pop_back();
+ visited[i] = 0;
+ count1 = 1;
+ }
+ if(!count1)
+ ans.push_back(temp);
+}
+vector> permute(vector& nums) {
+ vector > ans;
+ int visited[nums.size()];
+ memset(visited,0,sizeof(visited));
+ vector temp;
+ for(int i = 0; i < nums.size();++i)
+ {
+ visited[i] = 1;
+ temp.push_back(nums[i]);
+ DFS(visited,nums,ans,temp);
+ temp.pop_back();
+ visited[i] = 0;
+ }
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0047._Permutations_II.md b/docs/Algorithm/Leetcode/C++/0047._Permutations_II.md
new file mode 100755
index 00000000..a01e19a4
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0047._Permutations_II.md
@@ -0,0 +1,102 @@
+# 47. Permutations II
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/permutations-ii/
+
+>
+
+```
+Given a collection of numbers that might contain duplicates, return all possible unique permutations.
+
+Example:
+
+Input: [1,1,2]
+Output:
+[
+ [1,1,2],
+ [1,2,1],
+ [2,1,1]
+]
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n!*nlgn)******- ռ临Ӷ: O(n)******
+
+ǰǵеƣԲο֮ǰĽ֮ⷨǰĿֱӾsetȥˣȻͨˣʱ临ӶȱȽϸߣҪŻ
+
+```cpp
+class Solution {
+public:
+ void DFS(int* visited,vector& nums,set >& ans,vector temp)
+ {
+ int count1 = 0;
+ for(int i = 0;i < nums.size();++i)
+ if(!visited[i])
+ {
+ temp.push_back(nums[i]);
+ visited[i] = 1;
+ DFS(visited,nums,ans,temp);
+ temp.pop_back();
+ visited[i] = 0;
+ count1 = 1;
+ }
+ if(!count1)
+ ans.insert(temp);
+ }
+ vector> permuteUnique(vector& nums) {
+ vector > ans;
+ int visited[nums.size()];
+ memset(visited,0,sizeof(visited));
+ set > s;
+ vector temp;
+ for(int i = 0; i < nums.size();++i)
+ {
+ visited[i] = 1;
+ temp.push_back(nums[i]);
+ DFS(visited,nums,s,temp);
+ temp.pop_back();
+ visited[i] = 0;
+ }
+ for(auto pos = s.begin();pos != s.end();++pos)
+ ans.push_back(*pos);
+ return ans;
+ }
+};
+```
+> ˼·2
+******- ʱ临Ӷ: O(n!)******- ռ临Ӷ: O(n)******
+
+֮ǰǵľ顣ҲͨDFSķȥ⣬и⣬ͬ־ͻظȶͬ־ͻһȻDFSʱǴҽеģ˵һ֮ǰȲ֮ǰѾˣôǾͲ
+
+```cpp
+class Solution {
+public:
+ vector> permuteUnique(vector& nums) {
+ const int n = nums.size();
+ sort(nums.begin(), nums.end());
+ vector> ret;
+ vector visited(n, 0), arr;
+ dfs(nums, ret, arr, visited);
+ return ret;
+ }
+ void dfs(vector& nums, vector>& ret, vector& arr, vector& visited) {
+ if (arr.size() == nums.size()) {
+ ret.push_back(arr);
+ return;
+ }
+ for (int i = 0; i < nums.size(); ++i) {
+ if (visited[i]) {continue;}
+ if (i -1 >= 0 && nums[i] == nums[i-1] && !visited[i-1]) {continue;}
+ arr.push_back(nums[i]);
+ visited[i] = 1;
+ dfs(nums, ret, arr, visited);
+ arr.pop_back();
+ visited[i] = 0;
+ }
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0048._Rotate_Image.md b/docs/Algorithm/Leetcode/C++/0048._Rotate_Image.md
new file mode 100755
index 00000000..30feef74
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0048._Rotate_Image.md
@@ -0,0 +1,71 @@
+# 49. Group Anagrams
+
+ **难度: Medium**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode.com/problems/rotate-image/submissions/
+
+ > 内容描述
+
+ ```
+给你一个矩阵,让你顺时针旋转90° 思路: 不讨论复制一个数组然后在旋转的方法,因为太简单了。 下面的方法都是in-place的:。
+
+示例:
+
+输入:
+[
+ [1,2,3],
+ [4,5,6],
+ [7,8,9]
+],
+
+输出:
+[
+ [7,4,1],
+ [8,5,2],
+ [9,6,3]
+]
+说明:
+
+必须直接修改输入的2D矩阵。
+不要分配另一个2D矩阵并进行旋转。
+ ```
+
+## 解题方案
+> 思路 1
+```
+直接设置top, bottom, left, right四个变量,表示圈定当前要旋转的正方形范围,
+然后按偏移计算位置,比如左上角的先和右上角交换,然后继续左上角和右下角交换这样即可.
+```
+
+```cpp
+class Solution {
+public:
+ void rotate(vector>& matrix) {
+ if(matrix.empty())
+ return;
+ int top = 0, bottom = matrix.size() - 1;
+ int left = 0, right = matrix[0].size() - 1;
+ for(;top < bottom && left < right; ++top, ++left, --bottom, --right){
+ for(int i = left; i < right; ++i){
+ int dis = i - left;
+
+ int row = top + dis;
+ int col = right;
+ swap(matrix[top][i], matrix[row][col]);
+
+ row = bottom;
+ col = right - dis;
+ swap(matrix[top][i], matrix[row][col]);
+
+ row = bottom - dis;
+ col = left;
+ swap(matrix[top][i], matrix[row][col]);
+ }
+ }
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0049._Group_Anagrams.md b/docs/Algorithm/Leetcode/C++/0049._Group_Anagrams.md
new file mode 100755
index 00000000..e7cb3c46
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0049._Group_Anagrams.md
@@ -0,0 +1,53 @@
+# 49. Group Anagrams
+
+ **难度: Medium**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/group-anagrams/submissions/
+
+ > 内容描述
+
+ ```
+给定一个字符串数组,将字母异位词组合在一起。字母异位词指字母相同,但排列不同的字符串。
+
+示例:
+
+输入: ["eat", "tea", "tan", "ate", "nat", "bat"],
+输出:
+[
+ ["ate","eat","tea"],
+ ["nat","tan"],
+ ["bat"]
+]
+说明:
+
+所有输入均为小写字母。
+不考虑答案输出的顺序。
+ ```
+
+## 解题方案
+> 思路 1
+```
+不同的组别字符串元素相同,顺序不同,所以排序后相同
+把排序后相同的元素映射到同一个vector
+所有vector的组合就是结果
+```
+
+```cpp
+vector> groupAnagrams(vector& strs) {
+ vector> ans;
+ map> maps;
+ for(int i=0;i难度:Medium**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/powx-n/
+
+> 内容描述
+
+```
+mplement pow(x, n), which calculates x raised to the power n (xn).
+
+Example 1:
+
+Input: 2.00000, 10
+Output: 1024.00000
+Example 2:
+
+Input: 2.10000, 3
+Output: 9.26100
+Example 3:
+
+Input: 2.00000, -2
+Output: 0.25000
+Explanation: 2-2 = 1/22 = 1/4 = 0.25
+Note:
+
+-100.0 < x < 100.0
+n is a 32-bit signed integer, within the range [?2^31, 2^31 ? 1]
+```
+
+> 思路1
+******- 时间复杂度: O(lgN)******- 空间复杂度: O(1)******
+
+求一个数的n次方是我们经常用的函数,一般刚开始可能会用暴力的方法去求,做了n次循环,但由于这里的n非常大,单纯的暴力会TLE,这里可以用分治的思想,比如``2*2*2*2``,我们前面已经计算过``2*2``了,那么后面就不用再计算依次,就相当于``2*2*(2*2)``,这样时间复杂度就变成了lgN,接下来只要主要幂次是负数的情况即可
+
+```cpp
+class Solution {
+public:
+ double Pow(double x, long long n)
+ {
+ if(!n)
+ return 1;
+ if(n == 1)
+ return x;
+ double temp = Pow(x,(n)/ 2);
+ double ret;
+ if(n&1)
+ ret = temp * temp * x;
+ else
+ ret = temp * temp;
+ return ret;
+ }
+ double myPow(double x, int n) {
+ long long k = n;
+ if(n < 0)
+ x = 1 / x;
+ return Pow(x,n);
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0051._ N-Queens.md b/docs/Algorithm/Leetcode/C++/0051._ N-Queens.md
new file mode 100755
index 00000000..cc76bf93
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0051._ N-Queens.md
@@ -0,0 +1,91 @@
+# 51. N-Queens
+
+**Ѷ:Hard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/n-queens/
+
+>
+
+```
+The n-queens puzzle is the problem of placing n queens on an nn chessboard such that no two queens attack each other.
+
+
+
+Given an integer n, return all distinct solutions to the n-queens puzzle.
+
+Each solution contains a distinct board configuration of the n-queens' placement, where 'Q' and '.' both indicate a queen and an empty space respectively.
+
+Example:
+
+Input: 4
+Output: [
+ [".Q..", // Solution 1
+ "...Q",
+ "Q...",
+ "..Q."],
+
+ ["..Q.", // Solution 2
+ "Q...",
+ "...Q",
+ ".Q.."]
+]
+Explanation: There exist two distinct solutions to the 4-queens puzzle as shown above.
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(2^n)******- ռ临Ӷ: O(n)******
+
+ûݷȥ⡣ʵľͼʵľͻˣֱ¼ֱбϷбϷǷлʺ
+
+```cpp
+class Solution {
+public:
+ void travel(int* d,vector& ret,int level,int n,vector >& ans,int* l,int* r)
+ {
+ if(level >= n)
+ ans.push_back(ret);
+ for(int i = 0;i < n;++i)
+ if(!d[i] && !r[level + i] && !l[i - level + n])
+ {
+ d[i] = 1;
+ r[level + i] = 1;
+ l[i- level + n] = 1;
+ ret[level][i] = 'Q';
+ travel(d,ret,level + 1,n,ans,l,r);
+ d[i] = 0;
+ r[level + i] = 0;
+ l[i- level + n] = 0;
+ ret[level][i] = '.';
+ }
+ }
+ vector> solveNQueens(int n) {
+ int d[n];
+ int l[2 * n];
+ int r[2 * n];
+ memset(d,0,sizeof(d));
+ memset(l,0,sizeof(l));
+ memset(r,0,sizeof(r));
+ vector temp;
+ vector > ans;
+ string s(n,'.');
+ for(int i = 0;i < n;++i)
+ temp.push_back(s);
+ for(int i = 0;i < n;++i)
+ {
+ temp[0][i] ='Q';
+ d[i] = 1;
+ r[i] = 1;
+ l[i + n] = 1;
+ travel(d,temp,1,n,ans,l,r);
+ temp[0][i] = '.';
+ d[i] = 0;
+ r[i] = 0;
+ l[i + n] = 0;
+ }
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0052._N-Queens_II.md b/docs/Algorithm/Leetcode/C++/0052._N-Queens_II.md
new file mode 100755
index 00000000..2946e7e4
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0052._N-Queens_II.md
@@ -0,0 +1,84 @@
+# 52. N-Queens II
+
+**Ѷ:Hard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/n-queens-ii/
+
+>
+
+```
+The n-queens puzzle is the problem of placing n queens on an nn chessboard such that no two queens attack each other.
+
+
+
+Given an integer n, return the number of distinct solutions to the n-queens puzzle.
+
+Example:
+
+Input: 4
+Output: 2
+Explanation: There are two distinct solutions to the 4-queens puzzle as shown below.
+[
+ [".Q..", // Solution 1
+ "...Q",
+ "Q...",
+ "..Q."],
+
+ ["..Q.", // Solution 2
+ "Q...",
+ "...Q",
+ ".Q.."]
+]
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(2^n)******- ռ临Ӷ: O(n)******
+
+һһֻĶһ¾ͺãIJ˵
+
+```cpp
+class Solution {
+public:
+ int travel(int* d,int level,int n,int* l,int* r)
+ {
+ if(level >= n)
+ return 1;
+ int ans = 0;
+ for(int i = 0;i < n;++i)
+ if(!d[i] && !r[level + i] && !l[i - level + n])
+ {
+ d[i] = 1;
+ r[level + i] = 1;
+ l[i- level + n] = 1;
+ ans += travel(d,level + 1,n,l,r);
+ d[i] = 0;
+ r[level + i] = 0;
+ l[i- level + n] = 0;
+ }
+ return ans;
+ }
+ int totalNQueens(int n) {
+ int d[n];
+ int l[2 * n];
+ int r[2 * n];
+ memset(d,0,sizeof(d));
+ memset(l,0,sizeof(l));
+ memset(r,0,sizeof(r));
+ int ans = 0;
+ for(int i = 0;i < n;++i)
+ {
+ d[i] = 1;
+ r[i] = 1;
+ l[i + n] = 1;
+ ans += travel(d,1,n,l,r);
+ d[i] = 0;
+ r[i] = 0;
+ l[i + n] = 0;
+ }
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0053._Maximum_Subarray.md b/docs/Algorithm/Leetcode/C++/0053._Maximum_Subarray.md
new file mode 100755
index 00000000..d614e2d7
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0053._Maximum_Subarray.md
@@ -0,0 +1,79 @@
+# 053. Maximum Subarray
+
+**ѶEasy**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/maximum-subarray/
+
+>
+
+```
+Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
+
+Example:
+
+Input: [-2,1,-3,4,-1,2,1,-5,4],
+Output: 6
+Explanation: [4,-1,2,1] has the largest sum = 6.
+Follow up:
+
+If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle.
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(lgn)*****- ռ临Ӷ: O(1)******
+
+ñķȥ⣬˶뵽ǿԶ㷨Ż÷η˼룬Ϊ飬ֵ[left,mid]䣬[mid + 1,right]ںmidڣֻҪȡֵɡ
+```cpp
+class Solution {
+public:
+ int findArray(vector& nums,int beg,int en)
+ {
+ if(beg == en)
+ return nums[en];
+ int mid = (beg + en) / 2;
+ int temp = max(findArray(nums,beg,mid),findArray(nums,mid + 1,en));
+ int sum = 0,max1 = INT_MIN,max2 = INT_MIN;
+ for(int i = mid;i >= beg;--i)
+ {
+ sum += nums[i];
+ max1 = max(max1,sum);
+ }
+ sum = 0;
+ for(int i = mid + 1;i <= en;++i)
+ {
+ sum += nums[i];
+ max2 = max(max2,sum);
+ }
+ return max(temp,max1 + max2);
+ }
+ int maxSubArray(vector& nums) {
+ return findArray(nums,0,nums.size() - 1);
+ }
+};
+```
+> ˼·2
+******- ʱ临Ӷ: O(n)*****- ռ临Ӷ: O(1)******
+
+ﻹO(n)ʱ临Ӷ⣬飬ret > 0,ret =nums[i]
+ret += nums[i]
+
+```cpp
+class Solution {
+public:
+ int maxSubArray(vector& nums) {
+ int length = nums.size(),ret = nums[0],ans = nums[0];
+ for(int i = 1;i < length;++i)
+ {
+ if(ret <= 0)
+ ret = nums[i];
+ else
+ ret += nums[i];
+ ans = max(ans,ret);
+ }
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0054._Spiral_Matrix.md b/docs/Algorithm/Leetcode/C++/0054._Spiral_Matrix.md
new file mode 100755
index 00000000..c955cf57
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0054._Spiral_Matrix.md
@@ -0,0 +1,70 @@
+# 54. Spiral Matrix
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/spiral-matrix/submissions/
+
+>
+
+```
+Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
+
+Example 1:
+
+Input:
+[
+ [ 1, 2, 3 ],
+ [ 4, 5, 6 ],
+ [ 7, 8, 9 ]
+]
+Output: [1,2,3,6,9,8,7,4,5]
+Example 2:
+
+Input:
+[
+ [1, 2, 3, 4],
+ [5, 6, 7, 8],
+ [9,10,11,12]
+]
+Output: [1,2,3,4,8,12,11,10,9,5,6,7]
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n*m)******- ռ临Ӷ: O(1)******
+
+飬ҵɾУûʲôѶ
+
+```cpp
+class Solution {
+public:
+ vector spiralOrder(vector>& matrix) {
+ vector ans;
+ if(!matrix.size())
+ return ans;
+ int row = matrix[0].size(),colunm = matrix.size();
+ for(int i = 0;i < (matrix.size() + 1) / 2;++i)
+ {
+ if(row < 1 || colunm < 1)
+ break;
+ for(int j = 0;j < row;++j)
+ ans.push_back(matrix[i][i + j]);
+ if(colunm <= 1)
+ break;
+ for(int j = 1;j < colunm;++j)
+ ans.push_back(matrix[i + j][row + i - 1]);
+ if(row <= 1)
+ break;
+ for(int j = 1;j < row;++j)
+ ans.push_back(matrix[i + colunm - 1][row + i - 1 - j]);
+ for(int j = 1;j < colunm - 1;++j)
+ ans.push_back(matrix[i + colunm - 1 - j][i]);
+ row -= 2;
+ colunm -= 2;
+ }
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0055._Jump_Game.md b/docs/Algorithm/Leetcode/C++/0055._Jump_Game.md
new file mode 100755
index 00000000..5d2d9ae4
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0055._Jump_Game.md
@@ -0,0 +1,60 @@
+# 55. Jump Game
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/jump-game/submissions/
+
+>
+
+```
+Given an array of non-negative integers, you are initially positioned at the first index of the array.
+
+Each element in the array represents your maximum jump length at that position.
+
+Determine if you are able to reach the last index.
+
+Example 1:
+
+Input: [2,3,1,1,4]
+Output: true
+Explanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.
+Example 2:
+
+Input: [3,2,1,0,4]
+Output: false
+Explanation: You will always arrive at index 3 no matter what. Its maximum
+ jump length is 0, which makes it impossible to reach the last index.
+```
+
+> ˼·
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(1)******
+
+տʼ뵽ľDPķDPĻʱ临ӶΪO(n^2)ȻǿԶ㷨Ż,ʱ临ӶO(n)ɡֻҪжÿһߵԶľ뼴ɣ[2,3,1,1,4]һֻߵ0ڶ[12]ԶľΪ4
+
+```cpp
+class Solution {
+public:
+ bool canJump(vector& nums) {
+ if(nums.size() <= 1)
+ return 1;
+ for(int i = 0,r = 0;i < nums.size() - 1;)
+ {
+ int max1 = 0;
+ while(i <= r)
+ {
+ max1 = max(max1,i + nums[i]);
+ ++i;
+ }
+ //cout << max1 << endl;
+ if(max1 >= nums.size() - 1)
+ return 1;
+ if(max1 <= r)
+ return 0;
+ r = max1;
+ }
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0056._Merge_Intervals.md b/docs/Algorithm/Leetcode/C++/0056._Merge_Intervals.md
new file mode 100755
index 00000000..493bddba
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0056._Merge_Intervals.md
@@ -0,0 +1,62 @@
+# 56. Merge Intervals
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/merge-intervals/
+
+>
+
+```
+Given a collection of intervals, merge all overlapping intervals.
+
+Example 1:
+
+Input: [[1,3],[2,6],[8,10],[15,18]]
+Output: [[1,6],[8,10],[15,18]]
+Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].
+Example 2:
+
+Input: [[1,4],[4,5]]
+Output: [[1,5]]
+Explanation: Intervals [1,4] and [4,5] are considered overlapping.
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(nlgn)******- ռ临Ӷ: O(1)******
+
+Ҫȶstartͱõ飬ཻͽ䶼ansཻͽϲIJans
+
+```cpp
+/**
+ * Definition for an interval.
+ * struct Interval {
+ * int start;
+ * int end;
+ * Interval() : start(0), end(0) {}
+ * Interval(int s, int e) : start(s), end(e) {}
+ * };
+ */
+class Solution {
+public:
+ vector merge(vector& intervals) {
+ vector ans;
+ if(!intervals.size())
+ return ans;
+ sort(intervals.begin(),intervals.end(),[](Interval a, Interval b){return a.start < b.start;});
+ for(int i = 0;i < intervals.size() - 1;++i)
+ if(intervals[i + 1].start <= intervals[i].end)
+ {
+ intervals[i + 1].start = intervals[i].start;
+ intervals[i].end = max(intervals[i].end,intervals[i + 1].end);
+ intervals[i + 1].end = intervals[i].end;
+ }
+ else
+ ans.push_back(intervals[i]);
+ ans.push_back(intervals[intervals.size() - 1]);
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0057._Insert_Interval.md b/docs/Algorithm/Leetcode/C++/0057._Insert_Interval.md
new file mode 100755
index 00000000..24b58bb5
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0057._Insert_Interval.md
@@ -0,0 +1,93 @@
+# 57. Insert Interval
+
+**Ѷ:Hard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/insert-interval/
+
+>
+
+```
+Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
+
+You may assume that the intervals were initially sorted according to their start times.
+
+Example 1:
+
+Input: intervals = [[1,3],[6,9]], newInterval = [2,5]
+Output: [[1,5],[6,9]]
+Example 2:
+
+Input: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8]
+Output: [[1,2],[3,10],[12,16]]
+Explanation: Because the new interval [4,8] overlaps with [3,5],[6,7],[8,10].
+```
+
+> ˼·
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(N)******
+
+ȼԭеλá飬αȽ䡣¼ l rֱҪӵյ㡣õλ֮ҵ intervals[i].end < l,ӽ飬[l,r] intervals[i].start > r䡣
+
+```cpp
+/**
+ * Definition for an interval.
+ * struct Interval {
+ * int start;
+ * int end;
+ * Interval() : start(0), end(0) {}
+ * Interval(int s, int e) : start(s), end(e) {}
+ * };
+ */
+class Solution {
+public:
+ vector insert(vector& intervals, Interval newInterval) {
+ int beg = newInterval.start,en = newInterval.end,l = beg,r = en;
+ int comp = beg;
+ for(int i = 0;i < intervals.size();++i)
+ {
+ if(comp < intervals[i].start)
+ {
+ comp == beg ? l = beg : r = en;
+ comp = comp == beg ? en : beg;
+ if(comp == en && en < intervals[i].start)
+ {
+ r = en;
+ break;
+ }
+ if(comp == beg)
+ break;
+ }
+ if(comp <= intervals[i].end)
+ {
+
+ comp == beg ? l = intervals[i].start : r = intervals[i].end;
+ comp = comp == beg ? en : beg;
+ if(comp == en && en <= intervals[i].end)
+ {
+ r = intervals[i].end;
+ break;
+ }
+ if(comp == beg)
+ break;
+ }
+ }
+ int i = 0;
+ vector ans;
+ for(;i < intervals.size();++i)
+ if(intervals[i].end < l)
+ ans.push_back(intervals[i]);
+ else
+ break;
+ Interval i1(l,r);
+ ans.push_back(i1);
+ for(;i < intervals.size();++i)
+ if(intervals[i].start > r)
+ break;
+ for(;i < intervals.size();++i)
+ ans.push_back(intervals[i]);
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0058._Length_of_Last_Word.md b/docs/Algorithm/Leetcode/C++/0058._Length_of_Last_Word.md
new file mode 100755
index 00000000..64093a4a
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0058._Length_of_Last_Word.md
@@ -0,0 +1,37 @@
+# 058. Length of Last Word
+
+**难度Easy**
+
+## 刷题内容
+> 原题连接
+
+* https://leetcode.com/problems/length-of-last-word/
+
+> 内容描述
+
+```
+Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
+
+If the last word does not exist, return 0.
+```
+
+> 思路
+******- 时间复杂度: O(n)*****- 空间复杂度: O(1)******
+
+这题我们只要从字符串的末尾开始向前找到第一个单词即可
+```cpp
+class Solution {
+public:
+ int lengthOfLastWord(string s) {
+ int i = s.length() - 1,length = s.length() - 1;
+ while((s[i] == ' ') &&(i >= 0))
+ {
+ --i;
+ --length;
+ }
+ while((s[i] != ' ') && (i >= 0))
+ --i;
+ return length- i;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0059._Spiral_Matrix_II.md b/docs/Algorithm/Leetcode/C++/0059._Spiral_Matrix_II.md
new file mode 100755
index 00000000..a2cf72fb
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0059._Spiral_Matrix_II.md
@@ -0,0 +1,60 @@
+# 59. Spiral Matrix II
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/spiral-matrix-ii/
+
+>
+
+```
+Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
+
+Example:
+
+Input: 3
+Output:
+[
+ [ 1, 2, 3 ],
+ [ 8, 9, 4 ],
+ [ 7, 6, 5 ]
+]
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n^2)******- ռ临Ӷ: O(n^2)******
+
+֮ǰתһķֻҪȷһ棬Ϊvector鲻ò
+
+```cpp
+class Solution {
+public:
+ vector> generateMatrix(int n) {
+ int temp[n][n];
+ int range = n,cur = 1;
+ for(int i = 0;i < (n + 1) / 2 ;++i)
+ {
+ for(int j = 0;j < range;++j)
+ temp[i][j + i] = cur++;
+ for(int j = 1;j < range;++j)
+ temp[i + j][i + range - 1] = cur++;
+ for(int j = 1;j < range;++j)
+ temp[i + range - 1][range + i - 1 -j] = cur++;
+ for(int j = 1;j < range - 1;++j)
+ temp[range + i - 1 - j][i] = cur++;
+ range -= 2;
+ }
+ vector > ans;
+ for(int i = 0;i < n;++i)
+ {
+ vector v;
+ for(int j = 0;j < n;++j)
+ v.push_back(temp[i][j]);
+ ans.push_back(v);
+ }
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0060._Permutation_Sequence.md b/docs/Algorithm/Leetcode/C++/0060._Permutation_Sequence.md
new file mode 100755
index 00000000..083f9b76
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0060._Permutation_Sequence.md
@@ -0,0 +1,73 @@
+# 60. Permutation Sequence
+
+**Ѷ:Medium**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/permutation-sequence/
+
+>
+
+```
+The set [1,2,3,...,n] contains a total of n! unique permutations.
+
+By listing and labeling all of the permutations in order, we get the following sequence for n = 3:
+
+"123"
+"132"
+"213"
+"231"
+"312"
+"321"
+Given n and k, return the kth permutation sequence.
+
+Note:
+
+Given n will be between 1 and 9 inclusive.
+Given k will be between 1 and n! inclusive.
+Example 1:
+
+Input: n = 3, k = 3
+Output: "213"
+Example 2:
+
+Input: n = 4, k = 9
+Output: "2314"
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n^2)******- ռ临Ӷ: O(n)******
+
+Ƚ˳иַУȻѭnΣÿҵȷearseʱ临ӶΪnܵʱ临ӶΪn^2
+
+```cpp
+class Solution {
+public:
+ string getPermutation(int n, int k){
+ int arr[n + 1];
+ string ans,org;
+ for(int i = 1;i <= n;++i)
+ {
+ org.push_back(i + '0');
+ i == 1 ? arr[i] = 1 : arr[i] = arr[i - 1] * i;
+ }
+ for(int i = n - 1;i > 0;--i)
+ {
+ int t = k / arr[i];
+ cout<< t<< endl;
+ k = (k) % arr[i];
+ if(!k)
+ {
+ k = arr[i];
+ t--;
+ }
+ ans.push_back(org[t]);
+ org.erase(org.begin() + t);
+ arr[i] = 0;
+ }
+ ans.push_back(org[0]);
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0061._Rotate_List.md b/docs/Algorithm/Leetcode/C++/0061._Rotate_List.md
new file mode 100755
index 00000000..4174df16
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0061._Rotate_List.md
@@ -0,0 +1,113 @@
+# 61. Rotate List
+
+
+
+**Ѷ:Medium**
+
+
+
+## ˢ
+
+> ԭ
+
+
+* https://leetcode.com/problems/rotate-list/
+
+
+
+>
+
+
+
+```
+
+Given a linked list, rotate the list to the right by k places, where k is non-negative.
+
+
+
+Example 1:
+
+
+
+Input: 1->2->3->4->5->NULL, k = 2
+
+Output: 4->5->1->2->3->NULL
+
+Explanation:
+
+rotate 1 steps to the right: 5->1->2->3->4->NULL
+
+rotate 2 steps to the right: 4->5->1->2->3->NULL
+
+
+Example 2:
+
+
+Input: 0->1->2->NULL, k = 4
+
+Output: 2->0->1->NULL
+
+Explanation:
+
+rotate 1 steps to the right: 2->0->1->NULL
+
+rotate 2 steps to the right: 1->2->0->NULL
+
+rotate 3 steps to the right: 0->1->2->NULL
+
+rotate 4 steps to the right: 2->0->1->NULL
+
+```
+
+
+
+> ˼·1
+
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(n)******
+
+
+
+nָijȣknijȡ࣬Ϊkij֮һѭҪظ
+
+
+
+```cpp
+/**
+ * Definition for singly-linked list.
+ * struct ListNode {
+ * int val;
+ * ListNode *next;
+ * ListNode(int x) : val(x), next(NULL) {}
+ * };
+ */
+class Solution {
+public:
+ ListNode* rotateRight(ListNode* head, int k) {
+ int len = 0;
+ ListNode* h = head;
+ ListNode* pre;
+ while(h)
+ {
+ ++len;
+ pre = h;
+ h = h ->next;
+ }
+ if(!len)
+ return head;
+ int count1 = len - k % len;
+ if(count1 == len)
+ return head;
+ h = head;
+ ListNode* tail;
+ while(count1)
+ {
+ tail = h;
+ h = h ->next;
+ --count1;
+ }
+ pre ->next = head;
+ tail ->next = nullptr;
+ return h;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0062._Unique_Paths.md b/docs/Algorithm/Leetcode/C++/0062._Unique_Paths.md
new file mode 100755
index 00000000..d45c7294
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0062._Unique_Paths.md
@@ -0,0 +1,63 @@
+# 62. Unique Paths
+
+ **难度: Medium**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/unique-paths/
+
+ > 内容描述
+
+ ```
+一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。
+
+机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。
+
+问总共有多少条不同的路径?
+
+
+
+例如,上图是一个7 x 3 的网格。有多少可能的路径?
+
+说明:m 和 n 的值均不超过 100。
+
+示例 1:
+
+输入: m = 3, n = 2
+输出: 3
+解释:
+从左上角开始,总共有 3 条路径可以到达右下角。
+1. 向右 -> 向右 -> 向下
+2. 向右 -> 向下 -> 向右
+3. 向下 -> 向右 -> 向右
+示例 2:
+
+输入: m = 7, n = 3
+输出: 28
+ ```
+
+## 解题方案
+> 思路 1
+```
+动态规划,走到(i,j)可以从(i-1,j),(i, j-1)两个方向
+最优子结构:
+ dp[i, j] = dp[i-1, j]+dp[i, j-1]
+```
+
+```cpp
+int uniquePaths(int m, int n) {
+ vector> dp(m, vector(n, 0));
+ for(int i=0;i难度:Medium**
+
+## 刷题内容
+
+> 原题连接
+
+* https://leetcode.com/problems/unique-paths-ii/
+
+> 内容描述
+
+```
+A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
+
+The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).
+
+Now consider if some obstacles are added to the grids. How many unique paths would there be?
+
+
+
+An obstacle and empty space is marked as 1 and 0 respectively in the grid.
+
+Note: m and n will be at most 100.
+
+Example 1:
+
+Input:
+[
+ [0,0,0],
+ [0,1,0],
+ [0,0,0]
+]
+Output: 2
+Explanation:
+There is one obstacle in the middle of the 3x3 grid above.
+There are two ways to reach the bottom-right corner:
+1. Right -> Right -> Down -> Down
+2. Down -> Down -> Right -> Right
+
+```
+
+
+> 思路1
+
+******- 时间复杂度: O(n^2)******- 空间复杂度: O(n^2)******
+
+运用动态规划的思想,写出状态转移方程,d(i,j) = d(i + 1,j) + d(i,j + 1),不过要注意边界值
+
+```cpp
+class Solution {
+public:
+ int uniquePathsWithObstacles(vector>& obstacleGrid) {
+ int length1 = obstacleGrid.size(),length2 = obstacleGrid[0].size();
+ long long dp[length1][length2];
+ memset(dp,0,sizeof(dp));
+ for(int i = length1 - 1;i >= 0;--i)
+ for(int j = length2 - 1;j >= 0;--j)
+ {
+ if(!obstacleGrid[i][j])
+ {
+ if(i == length1 - 1 && j == length2 - 1)
+ dp[i][j] = 1;
+ else
+ {
+ if(i == length1 - 1)
+ dp[i][j] = dp[i][j + 1];
+ else if(j == length2 - 1)
+ dp[i][j] = dp[i + 1][j];
+ else
+ dp[i][j] = dp[i][j + 1] + dp[i + 1][j];
+ }
+ }
+ }
+ return dp[0][0];
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0064._Minimum_Path_Sum.md b/docs/Algorithm/Leetcode/C++/0064._Minimum_Path_Sum.md
new file mode 100755
index 00000000..c3cda766
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0064._Minimum_Path_Sum.md
@@ -0,0 +1,52 @@
+# 64. Minimum Path Sum
+
+ **难度: Middle**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/minimum-path-sum/
+
+ > 内容描述
+
+ ```
+给定一个包含非负整数的 m x n 网格,请找出一条从左上角到右下角的路径,使得路径上的数字总和为最小。
+
+说明:每次只能向下或者向右移动一步。
+
+示例:
+
+输入:
+[
+ [1,3,1],
+ [1,5,1],
+ [4,2,1]
+]
+输出: 7
+解释: 因为路径 1→3→1→1→1 的总和最小。
+ ```
+
+## 解题方案
+> 思路 1
+```
+dp:
+1. 首行首列的路径只有一种,累加
+2. 其他都有两种方法,走到i,j的最小路径等于min(sum[i][j-1], sum[i-1][j])+grid[i][j]
+```
+
+```cpp
+int minPathSum(vector>& grid) {
+ int m = grid.size(), n = grid[0].size();
+ int dp[m][n];
+ dp[0][0] = grid[0][0];
+ for (int i = 1; i < m; ++i) dp[i][0] = grid[i][0] + dp[i - 1][0];
+ for (int i = 1; i < n; ++i) dp[0][i] = grid[0][i] + dp[0][i - 1];
+ for (int i = 1; i < m; ++i) {
+ for (int j = 1; j < n; ++j) {
+ dp[i][j] = grid[i][j] + min(dp[i - 1][j], dp[i][j - 1]);
+ }
+ }
+ return dp[m - 1][n - 1];
+}
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0065._Valid_Number.md b/docs/Algorithm/Leetcode/C++/0065._Valid_Number.md
new file mode 100755
index 00000000..17108087
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0065._Valid_Number.md
@@ -0,0 +1,115 @@
+# 65. Valid Number
+
+**Ѷ:Hard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/valid-number/
+
+>
+
+```
+Validate if a given string can be interpreted as a decimal number.
+
+Some examples:
+"0" => true
+" 0.1 " => true
+"abc" => false
+"1 a" => false
+"2e10" => true
+" -90e3 " => true
+" 1e" => false
+"e3" => false
+" 6e-1" => true
+" 99e2.5 " => false
+"53.5e93" => true
+" --6 " => false
+"-+3" => false
+"95a54e53" => false
+Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one. However, here is a list of characters that can be in a valid decimal number:
+
+Numbers 0-9
+Exponent - "e"
+Positive/negative sign - "+"/"-"
+Decimal point - "."
+Of course, the context of these characters also matters in the input.
+```
+
+> ˼·
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(1)******
+
+õģĿʵҪַҪɣҪеǽȥnumberǰɸո.1"1.ںϷ֡
+
+```cpp
+class Solution {
+public:
+ void blank(int& i,string& s)
+ {
+ while(i < s.length() && s[i] == ' ')
+ i++;
+ }
+ bool firstHalf(int& i,string& s)
+ {
+ int num = 0;
+ for(;i < s.length();++i)
+ if(isdigit(s[i]))
+ continue;
+ else if(s[i] == '.')
+ {
+ if(num)
+ return 0;
+ num++;
+ }
+ else if(s[i] == 'e' || s[i] == ' ')
+ return 1;
+ else
+ return 0;
+ return 1;
+ }
+ bool secondHalf(int& i,string& s)
+ {
+ if(i == s.length())
+ return 0;
+ if(s[i] =='-' || s[i] == '+')
+ ++i;
+ if(!isdigit(s[i]))
+ return 0;
+ for(;i < s.length();++i)
+ if(!isdigit(s[i]))
+ {
+ if(s[i] == ' ')
+ return 1;
+ return 0;
+ }
+ return 1;
+ }
+ bool isNumber(string s) {
+ int i = 0;
+ if(!s.length())
+ return 0;
+ blank(i,s);
+ if(i == s.length())
+ return 0;
+ if(s[i] == '-' || s[i] == '+')
+ ++i;
+ int temp = i;
+ if(!firstHalf(i,s))
+ return 0;
+ if(i == temp)
+ return 0;
+ if(i - 1 == temp && s[i - 1] == '.')
+ return 0;
+ if(i == s.length())
+ return 1;
+ if(s[i] == 'e')
+ {
+ i++;
+ if(!secondHalf(i,s))
+ return 0;
+ }
+ blank(i,s);
+ return i == s.length();
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0066._Plus_One.md b/docs/Algorithm/Leetcode/C++/0066._Plus_One.md
new file mode 100755
index 00000000..3ed9779a
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0066._Plus_One.md
@@ -0,0 +1,57 @@
+# 66. Plus One
+
+**Ѷ:Easy**
+
+## ˢ
+
+> ԭ
+
+* https://leetcode.com/problems/plus-one/
+
+>
+
+```
+Given a non-empty array of digits representing a non-negative integer, plus one to the integer.
+
+The digits are stored such that the most significant digit is at the head of the list, and each element in the array contain a single digit.
+
+You may assume the integer does not contain any leading zero, except the number 0 itself.
+
+Example 1:
+
+Input: [1,2,3]
+Output: [1,2,4]
+Explanation: The array represents the integer 123.
+Example 2:
+
+Input: [4,3,2,1]
+Output: [4,3,2,2]
+Explanation: The array represents the integer 4321.
+
+```
+
+
+> ˼·1
+
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(1)******
+
+ַתּɣҪעпܻһ
+
+```cpp
+class Solution {
+public:
+ vector plusOne(vector& digits) {
+ int i = digits.size() - 1;
+ while((i >= 0) && (digits[i] == 9))
+ {
+ digits[i] = 0;
+ --i;
+ }
+ if(i < 0)
+ digits.insert(digits.begin(),1);
+ else
+ ++digits[i];
+ return digits;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0068._Text_Justification.md b/docs/Algorithm/Leetcode/C++/0068._Text_Justification.md
new file mode 100755
index 00000000..df005384
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0068._Text_Justification.md
@@ -0,0 +1,140 @@
+# 68. Text Justification
+
+**Ѷ:Hard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/text-justification/
+
+>
+
+```
+Given an array of words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified.
+
+You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad extra spaces ' ' when necessary so that each line has exactly maxWidth characters.
+
+Extra spaces between words should be distributed as evenly as possible. If the number of spaces on a line do not divide evenly between words, the empty slots on the left will be assigned more spaces than the slots on the right.
+
+For the last line of text, it should be left justified and no extra space is inserted between words.
+
+Note:
+
+A word is defined as a character sequence consisting of non-space characters only.
+Each word's length is guaranteed to be greater than 0 and not exceed maxWidth.
+The input array words contains at least one word.
+Example 1:
+
+Input:
+words = ["This", "is", "an", "example", "of", "text", "justification."]
+maxWidth = 16
+Output:
+[
+ "This is an",
+ "example of text",
+ "justification. "
+]
+Example 2:
+
+Input:
+words = ["What","must","be","acknowledgment","shall","be"]
+maxWidth = 16
+Output:
+[
+ "What must be",
+ "acknowledgment ",
+ "shall be "
+]
+Explanation: Note that the last line is "shall be " instead of "shall be",
+ because the last line must be left-justified instead of fully-justified.
+ Note that the second line is also left-justified becase it contains only one word.
+Example 3:
+
+Input:
+words = ["Science","is","what","we","understand","well","enough","to","explain",
+ "to","a","computer.","Art","is","everything","else","we","do"]
+maxWidth = 20
+Output:
+[
+ "Science is what we",
+ "understand well",
+ "enough to explain to",
+ "a computer. Art is",
+ "everything else we",
+ "do "
+]
+```
+
+> ˼·
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(n)******
+
+ĿѣĿ˼ȼһɶٵʣÿ֮һոָͿԼÿɶٵʡÿеȷʽܹĿոԼܿոԼΪ0Ϊ֮Ŀո r Ϊ0ͷʼ r ո1ʣµIJ䡣һҪעÿ֮ĿոΪ1ַmaxWidthʣµÿո䡣
+
+```cpp
+class Solution {
+public:
+ vector fullJustify(vector& words, int maxWidth) {
+ int l = 0,r = 0,sum = 0;
+ vector ans;
+ for(int i = 0;i < words.size();++i)
+ {
+ sum += words[i].length();
+ if(sum <= maxWidth)
+ {
+ sum += 1;
+ r++;
+ }
+ else
+ {
+ string temp;
+ sum -= (r - l + words[i].length());
+ int residue = 0, divide = (maxWidth - words[l].length());
+ if(l + 1 != r)
+ {
+ residue = (maxWidth - sum) % (r - l - 1);
+ divide = (maxWidth - sum - residue) / (r - l - 1);
+ }
+ temp.append(words[l].begin(),words[l].end());
+ for(int j = l + 1;j < r - 1;++j)
+ {
+ int k = residue > 0 ? divide + 1 : divide;
+ while(k)
+ {
+ temp.push_back(' ');
+ --k;
+ }
+ temp.append(words[j].begin(),words[j].end());
+ residue--;
+ }
+ int k = residue > 0 ? divide +1 : divide;
+ while(k)
+ {
+ temp.push_back(' ');
+ --k;
+ }
+ if(l + 1 != r)
+ temp.append(words[r - 1].begin(),words[r - 1].end());
+ ans.push_back(temp);
+ l = r++;
+ sum = words[i].length() + 1;
+ }
+ }
+ sum -= 1;
+ string temp;
+ temp.append(words[l].begin(),words[l].end());
+ for(int i = l + 1;i < r;++i)
+ {
+ temp.push_back(' ');
+ temp.append(words[i].begin(),words[i].end());
+ }
+ int k = maxWidth - sum;
+ while(k)
+ {
+ temp.push_back(' ');
+ --k;
+ }
+ ans.push_back(temp);
+ return ans;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0069._Sqr(x).md b/docs/Algorithm/Leetcode/C++/0069._Sqr(x).md
new file mode 100755
index 00000000..47946457
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0069._Sqr(x).md
@@ -0,0 +1,73 @@
+# 69. Sqrt(x)
+
+**Ѷ:Easy**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/sqrtx/
+
+>
+
+```
+Implement int sqrt(int x).
+
+Compute and return the square root of x, where x is guaranteed to be a non-negative integer.
+
+Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned.
+
+Example 1:
+
+Input: 4
+Output: 2
+Example 2:
+
+Input: 8
+Output: 2
+Explanation: The square root of 8 is 2.82842..., and since
+ the decimal part is truncated, 2 is returned.
+```
+
+> ˼·1
+******- ʱ临Ӷ: O(n)******- ռ临Ӷ: O(1)******
+
+0xЩƽֱx
+
+```cpp
+class Solution {
+public:
+ int mySqrt(int x) {
+ int i = 0;
+ if(!x || x == 1)
+ return x;
+ for(;i < x;++i)
+ if((long long)i * i > x)
+ break;
+ return i - 1;
+ }
+};
+```
+> ˼·2
+******- ʱ临Ӷ: O(lgn)******- ռ临Ӷ: O(1)******
+
+ԣҿԽһŻöַ0Ϊ½磬xΪϽ磬ͿԽж
+
+```cpp
+class Solution {
+public:
+ int mySqrt(int x) {
+ int l = 0, r= x;
+ while(l < r)
+ {
+ long long mid = (l + r) / 2,temp = mid * mid;
+ if(temp == x)
+ return mid;
+ if(temp < x)
+ l = mid + 1;
+ else
+ r = mid - 1;
+ }
+ return l * l <= x ? l : l - 1;
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0072._Edit_Distance.md b/docs/Algorithm/Leetcode/C++/0072._Edit_Distance.md
new file mode 100755
index 00000000..1cca984f
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0072._Edit_Distance.md
@@ -0,0 +1,70 @@
+# 72. Edit Distance
+
+**难度Hard**
+
+## 刷题内容
+> 原题连接
+
+* https://leetcode.com/problems/edit-distance/
+
+> 内容描述
+
+```
+You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.
+
+Example 1:
+
+Input:
+ s = "barfoothefoobarman",
+ words = ["foo","bar"]
+Output: [0,9]
+Explanation: Substrings starting at index 0 and 9 are "barfoor" and "foobar" respectively.
+The output order does not matter, returning [9,0] is fine too.
+Example 2:
+
+Input:
+ s = "wordgoodstudentgoodword",
+ words = ["word","student"]
+Output: []
+
+```
+> 思路
+******- 时间复杂度: O(n^2)******- 空间复杂度: O(n^2)******
+
+这题可以动态规划的思想去解决,首先定义两个指针 i 和 j,分别指向字符串的末尾。从两个字符串的末尾开始比较,相等,则```--i,--j```。若不相等,有三种情况,删除 i 指向的字符,在 i 指向的字符之后增加一个字符,替换 i 指向的字符, 接着比较这三次的操作的次数,取最小值即可,不过这里要注意递归操作时会重复计算,所以我们用一个数组 dp[i][j],表示 i 在words1中的位置,j 在 words2 的位置。由于c++对动态数组的支持不是很好,这里我用 vector 代替,在效率上可能较欠缺。
+
+```cpp
+class Solution {
+public:
+ vector > dp;
+ int minLen(string& w1,string& w2,int i,int j)
+ {
+ if(i < 0)
+ return j + 1;
+ if(j < 0)
+ return i + 1;
+ if(dp[i][j])
+ return dp[i][j];
+ if(w1[i] == w2[j])
+ {
+ dp[i][j] = minLen(w1,w2,i - 1,j - 1);
+ return dp[i][j];
+ }
+ int temp1 = min(minLen(w1,w2,i - 1,j) + 1,minLen(w1,w2,i - 1,j - 1) + 1);
+ dp[i][j] = min(minLen(w1,w2,i,j - 1) + 1,temp1);
+ return dp[i][j];
+ }
+ int minDistance(string word1, string word2) {
+ int i = word1.length() - 1,j = word2.length() - 1;
+ for(int t1 = 0;t1 <= i;++t1)
+ {
+ vector v1;
+ for(int t2 = 0;t2 <= j;++t2)
+ v1.push_back(0);
+ dp.push_back(v1);
+ }
+ int m = minLen(word1,word2,i,j);
+ return m;
+ }
+};
+```
diff --git a/docs/Algorithm/Leetcode/C++/0075._Sort_Colors.md b/docs/Algorithm/Leetcode/C++/0075._Sort_Colors.md
new file mode 100755
index 00000000..9b72ecc9
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0075._Sort_Colors.md
@@ -0,0 +1,61 @@
+# 75. Sort Colors
+
+ **难度: Medium**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/sort-colors/submissions/
+
+ > 内容描述
+
+ ```
+给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。
+
+此题中,我们使用整数 0、 1 和 2 分别表示红色、白色和蓝色。
+
+注意:
+不能使用代码库中的排序函数来解决这道题。
+
+示例:
+
+输入: [2,0,2,1,1,0]
+输出: [0,0,1,1,2,2]
+进阶:
+
+一个直观的解决方案是使用计数排序的两趟扫描算法。
+首先,迭代计算出0、1 和 2 元素的个数,然后按照0、1、2的排序,重写当前数组。
+你能想出一个仅使用常数空间的一趟扫描算法吗?
+ ```
+
+## 解题方案
+> 思路 1
+```
+记录两个指针,一个是0部分的后一位,另一个是2开头的前一个位置。
+遍历数组,遇到2,就和后一个指针交换(交换回来的有可能还是2,所以这个位置要再次判断)
+遇到0则和最后一个数的下一个位置交换。
+
+```
+
+```cpp
+void sortColors(vector& nums) {
+ int left = 0;
+ int right = nums.size()-1;
+ for(int i=0;i<=right;i++){
+ if(nums[i]==0){
+ int tmp = nums[left];
+ nums[left] = nums[i];
+ nums[i] = tmp;
+ left++;
+ }
+ else if(nums[i]==2){
+ int tmp = nums[i];
+ nums[i] = nums[right];
+ nums[right] = tmp;
+ right--;
+ i--;
+ }
+ }
+}
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0076._Minimum_Window_Substring.md b/docs/Algorithm/Leetcode/C++/0076._Minimum_Window_Substring.md
new file mode 100755
index 00000000..3db7417f
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0076._Minimum_Window_Substring.md
@@ -0,0 +1,74 @@
+# 76. Minimum Window Substring
+
+**Ѷ:Hard**
+
+## ˢ
+> ԭ
+
+* https://leetcode.com/problems/minimum-window-substring/
+
+>
+
+```
+Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
+
+Example:
+
+Input: S = "ADOBECODEBANC", T = "ABC"
+Output: "BANC"
+Note:
+
+If there is no such window in S that covers all characters in T, return the empty string "".
+If there is such window, you are guaranteed that there will always be only one unique minimum window in S.
+```
+
+> ˼·
+******- ʱ临Ӷ: O(N)******- ռ临Ӷ: O(N)******
+
+տʼ뵽 map ȥļֵַ˿ȥʱ临ӶΪO(n)һÿֵַĴű s̶һ䣬ʹڵַַ tͬҲһ鴢䡣ƶ伴ɡҵ̵䡣
+
+```cpp
+class Solution {
+public:
+ string minWindow(string s, string t) {
+ int arr[128],alNum = t.length();
+ memset(arr,0,sizeof(arr));
+ for(int i = 0;i < t.length();++i)
+ arr[t[i]]++;
+ vector v;
+ for(int i = 0;i < s.length();++i)
+ if(arr[s[i]])
+ v.push_back(i);
+ int s_map[128],beg = -1,en,ans = INT_MAX,count1 = 0,l,r;
+ memset(s_map,0,sizeof(s_map));
+ for(int i = 0;i < v.size();++i)
+ {
+ if(count1 != alNum)
+ {
+ if(beg == -1)
+ beg = i;
+ s_map[s[v[i]]]++;
+ if(s_map[s[v[i]]] <= arr[s[v[i]]])
+ count1++;
+ }
+ for(int j = beg;count1 == alNum;)
+ {
+ en = v[i];
+ s_map[s[v[j]]]--;
+ if(ans > en - v[beg])
+ {
+ l = v[beg];
+ r = en;
+ ans = en - v[beg];
+ }
+ if(s_map[s[v[j]]] < arr[s[v[j]]])
+ count1--;
+ beg = ++j;
+ }
+ }
+ if(ans == INT_MAX)
+ return "";
+ return s.substr(l,r - l + 1);
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0077._combinations.md b/docs/Algorithm/Leetcode/C++/0077._combinations.md
new file mode 100755
index 00000000..43420918
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0077._combinations.md
@@ -0,0 +1,53 @@
+# 77. Combinations
+
+**难度: Medium**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/combinations/
+
+ > 内容描述
+ ```
+给定两个整数 n 和 k,返回 1 ... n 中所有可能的 k 个数的组合。
+
+示例:
+
+输入: n = 4, k = 2
+输出:
+[
+ [2,4],
+ [3,4],
+ [2,3],
+ [1,2],
+ [1,3],
+ [1,4],
+]
+ ```
+
+## 解题方案
+> 思路 1
+```
+回溯寻找所有组合。
+```
+
+```cpp
+ void dfs(int k, int index, int n, vector& path, vector>& ans){
+ if(k==0){
+ ans.push_back(path);
+ return ;
+ }
+ for(int i=index;i<=n;i++){
+ path.push_back(i);
+ dfs(k-1, i+1, n, path, ans);
+ path.pop_back();
+ }
+}
+vector> combine(int n, int k) {
+ vector> ans;
+ vector path;
+ dfs(k, 1, n, path, ans);
+ return ans;
+}
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0078._subsets.md b/docs/Algorithm/Leetcode/C++/0078._subsets.md
new file mode 100755
index 00000000..fc22be46
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0078._subsets.md
@@ -0,0 +1,56 @@
+# 78. Subsets
+
+ **难度: Medium**
+
+ ## 刷题内容
+
+ > 原题连接
+
+* https://leetcode-cn.com/problems/subsets/
+
+ > 内容描述
+ ```
+给定一组不含重复元素的整数数组 nums,返回该数组所有可能的子集(幂集)。
+
+说明:解集不能包含重复的子集。
+
+示例:
+
+输入: nums = [1,2,3]
+输出:
+[
+ [3],
+ [1],
+ [2],
+ [1,2,3],
+ [1,3],
+ [2,3],
+ [1,2],
+ []
+]
+ ```
+
+## 解题方案
+> 思路 1
+```
+每个元素有两种选择,选与不选,可以使用K位二进制数组表示K个元素的选与不选。
+```
+
+```cpp
+vector> subsets(vector& nums) {
+ vector> ans;
+ for(int i=0;i tmp;
+ int index = 0;
+ int j=i;
+ while(j){
+ if(j%2==1)
+ tmp.push_back(nums[index]);
+ index++;
+ j/=2;
+ }
+ ans.push_back(tmp);
+ }
+ return ans;
+}
+```
\ No newline at end of file
diff --git a/docs/Algorithm/Leetcode/C++/0081._Search_in_Rotated_Sorted_Array_II.md b/docs/Algorithm/Leetcode/C++/0081._Search_in_Rotated_Sorted_Array_II.md
new file mode 100755
index 00000000..ab201271
--- /dev/null
+++ b/docs/Algorithm/Leetcode/C++/0081._Search_in_Rotated_Sorted_Array_II.md
@@ -0,0 +1,82 @@
+# 81. Search in Rotated Sorted Array II
+
+**