From 331b39daa5ef9f87fef4a8ec1804eeccc251caf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=8F=87=E9=B9=83=E6=8C=B5=E9=8D=97=3F?= <1210673897@qq.com> Date: Wed, 18 Nov 2020 08:37:21 +0800 Subject: [PATCH] AutoPush --- ...6\347\275\256\350\264\246\345\217\267.bat" | 2 + ...7\346\215\242\345\210\206\346\224\257.bat" | 2 + ...2\345\212\250\346\217\220\344\272\244.bat" | 3 + base/work1/MainTest.class | Bin 0 -> 442 bytes base/work1/MainTest.java | 20 ++++ base/work1/MyStack.class | Bin 0 -> 1430 bytes base/work1/MyStack.java | 54 +++++++++++ base/work2/LLStack.class | Bin 0 -> 1760 bytes base/work2/LLStack.java | 86 ++++++++++++++++++ base/work2/MainTest.class | Bin 0 -> 469 bytes base/work2/MainTest.java | 24 +++++ base/work2/StackNode.class | Bin 0 -> 337 bytes base/work3/Main.class | Bin 0 -> 435 bytes base/work3/Main.java | 14 +++ base/work3/MyQueue.class | Bin 0 -> 1497 bytes base/work3/MyQueue.java | 55 +++++++++++ base/work4/LLQueue.class | Bin 0 -> 1615 bytes base/work4/LLQueue.java | 82 +++++++++++++++++ base/work4/Main.class | Bin 0 -> 444 bytes base/work4/Main.java | 17 ++++ base/work4/MyNode.class | Bin 0 -> 312 bytes 21 files changed, 359 insertions(+) create mode 100644 "1,\350\256\276\347\275\256\350\264\246\345\217\267.bat" create mode 100644 "2,\345\210\207\346\215\242\345\210\206\346\224\257.bat" create mode 100644 "3,\350\207\252\345\212\250\346\217\220\344\272\244.bat" create mode 100644 base/work1/MainTest.class create mode 100644 base/work1/MainTest.java create mode 100644 base/work1/MyStack.class create mode 100644 base/work1/MyStack.java create mode 100644 base/work2/LLStack.class create mode 100644 base/work2/LLStack.java create mode 100644 base/work2/MainTest.class create mode 100644 base/work2/MainTest.java create mode 100644 base/work2/StackNode.class create mode 100644 base/work3/Main.class create mode 100644 base/work3/Main.java create mode 100644 base/work3/MyQueue.class create mode 100644 base/work3/MyQueue.java create mode 100644 base/work4/LLQueue.class create mode 100644 base/work4/LLQueue.java create mode 100644 base/work4/Main.class create mode 100644 base/work4/Main.java create mode 100644 base/work4/MyNode.class diff --git "a/1,\350\256\276\347\275\256\350\264\246\345\217\267.bat" "b/1,\350\256\276\347\275\256\350\264\246\345\217\267.bat" new file mode 100644 index 0000000..80ffb4d --- /dev/null +++ "b/1,\350\256\276\347\275\256\350\264\246\345\217\267.bat" @@ -0,0 +1,2 @@ +git config --global user.name "曾钰华" +git config --global user.email "1210673897@qq.com" \ No newline at end of file diff --git "a/2,\345\210\207\346\215\242\345\210\206\346\224\257.bat" "b/2,\345\210\207\346\215\242\345\210\206\346\224\257.bat" new file mode 100644 index 0000000..f55c005 --- /dev/null +++ "b/2,\345\210\207\346\215\242\345\210\206\346\224\257.bat" @@ -0,0 +1,2 @@ +git branck 2 +git checkout 2 \ No newline at end of file diff --git "a/3,\350\207\252\345\212\250\346\217\220\344\272\244.bat" "b/3,\350\207\252\345\212\250\346\217\220\344\272\244.bat" new file mode 100644 index 0000000..0fbd52f --- /dev/null +++ "b/3,\350\207\252\345\212\250\346\217\220\344\272\244.bat" @@ -0,0 +1,3 @@ +git add . +git commit -m "AutoPush" +git push \ No newline at end of file diff --git a/base/work1/MainTest.class b/base/work1/MainTest.class new file mode 100644 index 0000000000000000000000000000000000000000..81172e28b9c456dd1bd78a3fc85a43a1b90b35ed GIT binary patch literal 442 zcmYL^+e*Vg5QhIvlctTSO^+UGgL8qCZdn!O$!P> zfDa|kEJ_3W?auDZe3S2=k1qhnXd1|&q@!#=L4{Fe)EIRg8#*=xvgdx_Cl>-4d;d;A zy$l~cfnv`Oyqk13^x}a#oYIXtbNxV|Za?%U?u*-0b*aYxS_ZkgC-G+>z6;n&=MiGZ~d+zuz+C?UIjEvJjp`4hP! z(k8MQ%^igiTF~iV`BNZRM_i+*NxPt3J6J-z(?P%_X5}R(7O+ldPJKm&ihU2has7=F&|uroWIw%aW&)P+J(V7u5|Dj$L^Sc(*@MNHP1P-5b=JHe^@G1<-< z>zxS^z3_?{zix^*#AqU*U1DkY0bcqWY~jv(W5nm3nSLl}vU$(WIq!MC-r4=-ujTsy zj$+C}4-TcU9nVS`l2Wi(iYXk%u!-j^9Kli9IcDOxf#)r>;gFOQCQi!wf|L;xqb5$7 zIBnoX17iwFrxZA|?<#1QCl!pU^M1+uz*SIuN(6PE9iv{&3r;KOxyivdxty(++0Z%V z)!f&b)fu<(hBH&)j^WLptNOtLFXjfP71~4O3yvS3C%yTJW~D*|zd8R7yL^FXuYmfl zOA&k^ujMzqS`h29O7&)A)}8Q#!oIK&ZWrd9_Z%Bp?6>h0`fTi!(u*B7_F=DqGd9L? zmLk^{KVG|ckgV<$RezzjcaP#YPm;n{*dv=G@ufA6un``M|9*n0k{3JyT(`S1-OECDd@8>WD)3 z6Sm0_##pKGUM{-0#ngzTo^*WQt(6saakP)M#J-6?^rZX$({Bd#C_07hxyOM=Fu)hJ zhi`TQnoNz~G#O#Ia-LibD2{g*>ux@s;km}OFMk&*uPs5#XP1!3=YK+C#ae=Xn}?hN zYcIC38qm3>V4{O{CoGXz%>a$O|o<^RIyTF2-LF`nLVRH8s}v@hSnwl87dK{8{sVBRL4p1(w3{q1S` z%w800k*vsC56$(Wlc}Yd)BxXqkx4~qih2h7W07-VguqD>q+$X~2*`8~ZI|xC-k_S+ z%cLr_(4OgNp|gdwH2#ZsHv#*}yNA33IKe!&@E*Xyn0GwRwlCss6Jx>~lF?RSGv*Ge z1`ZJSAaMuR@j8i=+wgHM4(j|CA6;=!+GzG`9NsjP$xwY(Y;^OBFlNP6=0 ;i-- ){ + //System.out.printf("aStack[%d]=%d",i,aStack[i]); + System.out.println("aStack["+i+"]="+aStack[i]); + } + } +} \ No newline at end of file diff --git a/base/work2/LLStack.class b/base/work2/LLStack.class new file mode 100644 index 0000000000000000000000000000000000000000..7364d2742be2649659f494d1dfe81ac8dcb81896 GIT binary patch literal 1760 zcmaJ?>rdNN7=BJ$`fJONQA^oii~;Hd3LD7SMGK6}VBiX47Ez`jEbz@CnP%*15I z8-CbgvMjr(2{SQ^m&Bn^CXjvfgMWshFh4Evvr(V-*HRj{nY8DezURF>&-=Uwe*1g% z0f2VAd1>L<{%9h3iT;Vy>^tN}&xByn6EophGLS{2;0nf5GgHPuSaRz* z^Pvl&iy&D0aRjm?XgSy{T|y+L%!&-~94& z=JTr?_b+eU|1R_Khg(YvkJfMN7{}{6-VjLRm|($&Uw@xj|0VP3s*ZDblZL#n!hRN$ zsy7xkf4;u?*|p4-dk-I6qwjY4@{P5tbok>=Ix~Ndhs^4Avq%v23YOZ76e`~__YTxE zlNXFBDp_C(UYboBQ8qiC;zfDDbPmT`My2bdW`v>~fwCu9;&4?ILLxyi3$LN0?9m#lB2L*4#3lGP>Vb$yuj7PFu)F5&b>b8-a)(Ec*WhPmSOQ( zmtpl)EyK1Gy&FaJaWYz7VKJYhjxv-m2gfv*shxSG@H4(8#xKFP0L^w6HtP>GT1*gj z)4>fNEk&@Db_-MvELVZv%3U&)NQSST67AiNF76iZW^6P0f-RCJ4f@h3x&{3w*gaYr zj>R=NC#qK98s5G+sGEEVCO1PioI}Cl1hqF zOF<4$k`|s?`D%|-hE57`idLcMgvI?AYBU@q&_j8J{v=Fk`OPdI6KIJ57253DF(O~X zu89?tdfaKVpOz(f(kSzI`7@1jI%lOaNlXg~A-RIxfr8jQPmLwtfKOO2L1!xxc}7NE2*q zf}i|b^8CLcd*Oe!fPaPX7sV=h*ybV#15L#EE2??N6PvJCysGFW7lFI~{JwJ|^IE8w xpTIi^ypzCB5O_Cr>Y+Bhq|ry1C((s|3{bC844PnFuu?HE6{{uWRx{s={{okzdtU$m literal 0 HcmV?d00001 diff --git a/base/work2/LLStack.java b/base/work2/LLStack.java new file mode 100644 index 0000000..3533004 --- /dev/null +++ b/base/work2/LLStack.java @@ -0,0 +1,86 @@ +public class LLStack{ + StackNode top; + private int count; + private int maxSize; + + public LLStack(){ + } + + public LLStack(int size){ //ջɵĴС + top = null; + count = 0; + maxSize = size; + } + + public boolean isFull(){ + return count == maxSize; + } + + public boolean isEmpty(){ + return count <=0 ; + } + + public void push(int value){ + if(isFull()){ + System.out.println("ջˣ"); + return; + } + StackNode node = new StackNode(value); + if(isEmpty()){ + top = node; + count++; + return; + } + node.next = top; + top = node; + count++; + } + + public void pop(){ + if(isEmpty()){ + System.out.println("ջǿյģ"); + return; + } + if(count==1){ + System.out.println("һԪأ"+top.element+""); + top = null; + count--; + return; + } + StackNode temp = new StackNode(); + System.out.println("Ԫأ"+top.element+""); + temp = top; + top = top.next; + temp.next = null; + count--; + } + + public void printLLStack(){ + if(isEmpty()){ + System.out.println("ջ޷ӡ"); + return; + } + System.out.println("ջջף"); + StackNode temp = new StackNode(); + temp = top; + while(temp.next != null){ + System.out.println(temp.element); + System.out.println(" v"); + temp = temp.next; + } + System.out.println(temp.element); + } + + +} +class StackNode{ + int element; + StackNode next; + + public StackNode(int n){ + element = n; + next = null; + } + public StackNode(){ + } +} diff --git a/base/work2/MainTest.class b/base/work2/MainTest.class new file mode 100644 index 0000000000000000000000000000000000000000..9bdd46c24fb56a415e5495e2076bb6f7dd6d59ad GIT binary patch literal 469 zcmZvZ%SyvQ7=_QIm$YMQ)4P{e&{eczMO=s$5xjs9b zfDa{}35pvB=9`&+&YyF_e15%s0N6)OB88leyo82=LQ$clP}Wh=u_TaedcGGP3&gC= zTY>oL=)o1p+Me%TPlp|M+;%zxR^mg)^99P*z1?@7oyNfNdyQ5&_Wa(FYLu zJSEOtQQUSX;f~T8NJ9$fw%rPy?vpw$8(2|Tg)~rAx2fM20rSt`rqg%3A>FOZC|xj} zJPH^AZNs0>F?lcwunwJntA+-l49NwaYFq`^#MT_*l^eE`$*8D=87y+Iq%VlE890B3 zc4x{tVs_n>GsNp=G2&W8E8?Ew3<=KUKQr-Xbw~sHGf^5QS*BT)AvS1j@ot;dUF7&+ Vc^sgCCW<&g31_Gv}cx1DCSDxSyl zM}0164NFtj7o7G+Cl4%_RA~my1GQm6i(ApQzKRdQl+) zL?K%6LTteo_|w{02}*Sz-aJ4%Q?LtSb~0HWZ2uHXUpU0aai;}8ZN-p5d8{fD4VJBt9ztyRd?Cq5v3GGtd zh^DJ*!fQKVss2@jajr|B^(C)Cs#=8O^epJ{Bs F`vV+4L^l8c literal 0 HcmV?d00001 diff --git a/base/work3/Main.java b/base/work3/Main.java new file mode 100644 index 0000000..e6f0ae0 --- /dev/null +++ b/base/work3/Main.java @@ -0,0 +1,14 @@ +public class Main{ + public static void main(String args[]){ + MyQueue queue = new MyQueue(10); + queue.push(10); + queue.push(20); + queue.push(30); + queue.push(40); + queue.push(50); + queue.printQueue(); + queue.pop(); + queue.pop(); + queue.printQueue(); + } +} \ No newline at end of file diff --git a/base/work3/MyQueue.class b/base/work3/MyQueue.class new file mode 100644 index 0000000000000000000000000000000000000000..da9377e22e1b1ec47e45a3c08b3f2543104ea53a GIT binary patch literal 1497 zcmaJ>&r@4f6#njeFL}x1Q6iH?Ajlj;<#WsB?9t**Lv9Pv9hA;oERk~t^$+;hJ3edpZCuYa#^ z0XTta2d(IhVjud%^otn~bJU?Z7RAdr9>EC*Cvi$5gAtszamIm*UNJ)v42vHT^GXC~ zCG*t?Ms1w4ab6)bmn&t93Ti^Zy5@Unx}q0k6ilyBP%z%*MR+902F0_CCA;5Y!i8Mg zS7@3Hvi{}L!mM9-+ndcWVkIZ!J{&BLmofs8?7phdI8*fIKAiIMwJbYW99zg2mzbX~ zEnZ_9zbLHl(hie;^FPAHy-FURR z{9yg&a2MTSy&f;0_p@Ad8`t$zN=*^*`<_+*Klzbjt~wNj zmgLjGL=0(e=-@+b<@2^+$kzDFkUeV8Rcg=W(%T#wcTM{OPaX7}BSNV)sJr~3kf3!~ zE~yqGjI`@CNx#Ur+{7h472kC3!$_I;VT!TDgr0yLL|8*vXyC_142@*Dhfk}CpnO)e z0(z2=!l5~}N*=2)ww7UAE3nKT88tMau+C_~ON@kI#72cSpA)S>9HkeCMuGV5KdKMx zR5y%Dc4u9cCy=b}O_dS;7VbUR&5<&qcT-mgXT48VLQ788RXJMmX^~l_R+ZVtX|+?> zA<9fpVh4ICQRtdbF}CZf&-@p?C19TIoLajE-EI};2%B%fy|SjY80>5Im$9e0sf<_| z&oQk^DlMesR+w#B>18-_TH!sNkkmJEa~IQ2M9Jp}nRb$C7nyc*Aw4*SUW}p-@1Y+b z@E=lGCt$|5F$Tj%lGCEymMQ5|Eyn7dXY^4`(vUe4uMzqIUH_I6*E*VabnN|9sg>>D pWY#SrzCO=Z_5lX@SWc7MAdX=OXE3Z;MPd8}L;Xpj3MpOE^AEnsCcOXv literal 0 HcmV?d00001 diff --git a/base/work3/MyQueue.java b/base/work3/MyQueue.java new file mode 100644 index 0000000..2124f4a --- /dev/null +++ b/base/work3/MyQueue.java @@ -0,0 +1,55 @@ +public class MyQueue{ + private int count; + private int head; + private int tail; + private int[] arr; + + public MyQueue(){ + } + + public MyQueue(int size){ + arr = new int[size]; + head = 0; + tail = 0; + count = 0; + } + + //---------------------------------------------- + + public boolean isFull(){ + return count == arr.length; + } + + public boolean isEmpty(){ + return count == 0; + } + + public void push(int value){ + if(isFull()){ + System.out.println("Ԫˣ"); + return; + } + count++; + arr[tail++] = value; + } + + public void pop(){ + if(isEmpty()){ + System.out.println("ѿ"); + return; + } + int temp = head; + + System.out.println(arr[head]+""); + count--; + head = (head == arr.length - 1 ? head : head+1); + arr[temp]=0; + } + + public void printQueue(){ + for(int i = 0;i <= arr.length-1 ;i++){ + System.out.print(arr[i]+" "); + } + System.out.println(""); + } +} \ No newline at end of file diff --git a/base/work4/LLQueue.class b/base/work4/LLQueue.class new file mode 100644 index 0000000000000000000000000000000000000000..82de29bcff8c59b3b680e03e1a79c36186925349 GIT binary patch literal 1615 zcmaKrUvCs;6vm%-cXnrYI%SuZLQ7FVDP5*rwm@6J{&8t-wJ=+Xi)g)a+D>3_|D~NZ z)H@R|y!S%n22G5_#Kb__Z9TaEKMzLC7Uv=j_(Kegz zlQ*4D91}Y!sOE$L+h1zWD0V&V$Fh-|AR2aT!Yl z49gak0TWjw_XGyp!=L={P@zA}eti2UZlB!w{Li01YyBx45RhESsa($$eR5x)se7e0 zciqIh!coLkmX*y;%j>pbYO zgJ7?kTar%kyRK7a`?_D^<~M?NmMYB4go$mm6Tu`a?k&pdZpkgXGWWPstGN|kjYAye z3pvdS`N8bV1pg;K;a9^ZDeTL<+ydIy zxjV{LagA9!Q1|(waE#VKgjT0qf*y{WR>J4#my-_Wq~Y9eIhiS|xplC?B9;H4y(A<^$+mi3XDQcVR5|@1Ua)%Jy2r zQYnpQE%QU#M^Y}&G`h^^{S*w@$5}Qw8l7WFaUf~_-1<0(BYXzfS&O3>Wf^1KO|dOA zEXyXV)S5&j{TGhu7$Wg-Yi4)JD?zfWAj>+gJkFwI*!Twj^o`CW}#a zSV?gB9Pto|he@0zagOXGNxoc?Wyx=xU(5YhMFB4eW2=fP~oh{`s9T;bE`bv9P(v*&<+)s8d9p hCTbo%xWG0G)GT*%xQO`x%|MjR)YwdmfF}cu+`m9TGvxpP literal 0 HcmV?d00001 diff --git a/base/work4/LLQueue.java b/base/work4/LLQueue.java new file mode 100644 index 0000000..e7625be --- /dev/null +++ b/base/work4/LLQueue.java @@ -0,0 +1,82 @@ +public class LLQueue{ + MyNode head; + MyNode tail; + int count; + int maxSize; + + public LLQueue(){ + } + + public LLQueue(int size){ + maxSize = size; + head = null; + tail = null; + count = 0; + } + + public boolean isFull(){ + return count == maxSize; + } + + public boolean isEmpty(){ + return count == 0; + } + + public void push(int value){ + if(isFull()){ + System.out.println(""); + return; + } + MyNode node = new MyNode(value); + if(count == 0){ + head = node; + tail = node; + count++; + return; + } + tail.next = node; + tail = node; + count++; + } + + public void pop(){ + if(isEmpty()){ + System.out.println("ѿ"); + return; + } + if(head == tail){ + head = null; + tail = null; + count--; + return; + } + MyNode temp = head; + head = head.next; + temp = null; + count--; + } + + public void printLLQueue(){ + if(isEmpty()){ + System.out.println("ǿյģ"); + return; + } + MyNode temp = head; + while(temp.next != null){ + System.out.print(temp.element+"-->"); + temp = temp.next; + } + System.out.println(temp.element); + } +} +class MyNode{ + int element; + MyNode next; + + public MyNode(){ + } + + public MyNode(int n){ + element = n; + } +} \ No newline at end of file diff --git a/base/work4/Main.class b/base/work4/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..6eee07ec1f1c61922c5f14bfea060cad18e16bed GIT binary patch literal 444 zcmYk1T}uK%7=_R5hpXe7+lTgHUU-!yBvjCa(oGNqTM}b>=UF_dSWpD-Ts3z&Y( zlXF-tub9!zSjxDfIfu=a`?u_+!%^mA(!oZVeia6+F=B(2J;rOX-=_O9{ZFarz+;Xw H{SA1(%IigZ literal 0 HcmV?d00001 diff --git a/base/work4/Main.java b/base/work4/Main.java new file mode 100644 index 0000000..f492fcc --- /dev/null +++ b/base/work4/Main.java @@ -0,0 +1,17 @@ +public class Main{ + public static void main(String args[]){ + LLQueue q = new LLQueue(5); + + q.push(10); + q.push(11); + q.push(12); + q.push(13); + q.push(14); + q.printLLQueue(); + + q.pop(); + q.pop(); + q.pop(); + q.printLLQueue(); + } +} \ No newline at end of file diff --git a/base/work4/MyNode.class b/base/work4/MyNode.class new file mode 100644 index 0000000000000000000000000000000000000000..aa43a3b9eaa9416e3abfca827ffdf04b49f7bf50 GIT binary patch literal 312 zcmYLDu}%U}5S%>@j(eVfVrQcrULlR0#Ky#gin&JENavK}an806)q& zPYa7TZ+CWPcE7$qJ^@_e#2`d3MgvC?jwAF1k(RnvR|#Y+2%WyNY}?7(bn~Rwg4U>T zMRg-+3@#oixFs#<+QR9yUgx@f$nug*I2il6S#0X>69b5kARe$g=P&%5=^paVg6oLp*Jv3r jArs?}=;bMSA8EWiJ>4Pr_jI@tn9*}j$DEE1`vBb^BS$Y5 literal 0 HcmV?d00001 -- Gitee