From dc7d25db5d270c61bc6d9b16713b449ab83d7328 Mon Sep 17 00:00:00 2001 From: Yang Luo <779446731@qq.com> Date: Sun, 17 Aug 2014 15:52:31 +0800 Subject: [PATCH] first commit --- .classpath | 6 + .idea/.name | 1 + .idea/compiler.xml | 23 + .idea/copyright/profiles_settings.xml | 3 + .idea/encodings.xml | 5 + .idea/misc.xml | 10 + .idea/modules.xml | 9 + .idea/scopes/scope_settings.xml | 5 + .idea/vcs.xml | 7 + .idea/workspace.xml | 620 ++++++++++++++++++ .project | 17 + .settings/org.eclipse.jdt.core.prefs | 11 + LeetCodeNew.iml | 12 + bin/linearlist/Candy.class | Bin 0 -> 805 bytes bin/linearlist/FourSum.class | Bin 0 -> 1920 bytes bin/linearlist/GasStation.class | Bin 0 -> 640 bytes .../LongestConsecutiveSequence.class | Bin 0 -> 2206 bytes bin/linearlist/MedianofTwoSortedArrays.class | Bin 0 -> 1599 bytes bin/linearlist/NextPermutation.class | Bin 0 -> 1469 bytes bin/linearlist/PermutationSequence.class | Bin 0 -> 1739 bytes .../RemoveDuplicatesfromSortedArray.class | Bin 0 -> 585 bytes .../RemoveDuplicatesfromSortedArrayII.class | Bin 0 -> 1315 bytes bin/linearlist/RemoveElement.class | Bin 0 -> 530 bytes bin/linearlist/RotateImage.class | Bin 0 -> 1422 bytes .../SearchinRotatedSortedArray.class | Bin 0 -> 1024 bytes .../SearchinRotatedSortedArrayII.class | Bin 0 -> 741 bytes bin/linearlist/SetMatrixZeroes.class | Bin 0 -> 788 bytes bin/linearlist/ThreeSum.class | Bin 0 -> 1790 bytes bin/linearlist/ThreeSumClosest.class | Bin 0 -> 1186 bytes bin/linearlist/TrappingRainWater.class | Bin 0 -> 1054 bytes bin/linearlist/TwoSum.class | Bin 0 -> 1760 bytes bin/linearlist/ValidSudoku.class | Bin 0 -> 1321 bytes bin/linkedlist/AddTwoNumbers.class | Bin 0 -> 1241 bytes .../CopyListwithRandomPointer.class | Bin 0 -> 322 bytes bin/linkedlist/ListNode.class | Bin 0 -> 367 bytes bin/linkedlist/PartitionList.class | Bin 0 -> 863 bytes bin/linkedlist/RandomListNode.class | Bin 0 -> 385 bytes .../RemoveDuplicatesfromSortedListII.class | Bin 0 -> 1126 bytes .../RemoveNthNodeFromEndofList.class | Bin 0 -> 795 bytes bin/linkedlist/ReverseLinkedListII.class | Bin 0 -> 892 bytes bin/linkedlist/ReverseNodesinkGroup.class | Bin 0 -> 1250 bytes bin/linkedlist/RotateList.class | Bin 0 -> 1799 bytes .../EvaluateReversePolishNotation.class | Bin 0 -> 1840 bytes .../LargestRectangleinHistogram.class | Bin 0 -> 2042 bytes bin/stackqueue/LongestValidParentheses.class | Bin 0 -> 1534 bytes bin/stackqueue/ValidParentheses.class | Bin 0 -> 1691 bytes bin/string/AddBinary.class | Bin 0 -> 1068 bytes bin/string/Anagrams.class | Bin 0 -> 2035 bytes bin/string/CountandSay.class | Bin 0 -> 1439 bytes bin/string/ImplementstrStr.class | Bin 0 -> 1096 bytes bin/string/LengthofLastWord.class | Bin 0 -> 908 bytes bin/string/LongestCommonPrefix.class | Bin 0 -> 1184 bytes bin/string/LongestPalindromicSubstring.class | Bin 0 -> 1490 bytes bin/string/SimplifyPath.class | Bin 0 -> 1657 bytes bin/string/StringtoIntegeratoi.class | Bin 0 -> 1230 bytes bin/string/ValidPalindrome.class | Bin 0 -> 1433 bytes bin/tree/BinaryTreeInorderTraversal.class | Bin 0 -> 1735 bytes bin/tree/BinaryTreeLevelOrderTraversal.class | Bin 0 -> 2750 bytes .../BinaryTreeLevelOrderTraversalII.class | Bin 0 -> 1678 bytes bin/tree/BinaryTreePostorderTraversal.class | Bin 0 -> 2357 bytes bin/tree/BinaryTreePreorderTraversal.class | Bin 0 -> 2170 bytes .../BinaryTreeZigzagLevelOrderTraversal.class | Bin 0 -> 1800 bytes bin/tree/SameTree.class | Bin 0 -> 1245 bytes bin/tree/SymmetricTree.class | Bin 0 -> 781 bytes bin/tree/TreeNode.class | Bin 0 -> 352 bytes src/linearlist/Candy.java | 32 + src/linearlist/FourSum.java | 61 ++ src/linearlist/GasStation.java | 19 + .../LongestConsecutiveSequence.java | 75 +++ src/linearlist/MedianofTwoSortedArrays.java | 57 ++ src/linearlist/NextPermutation.java | 50 ++ src/linearlist/PermutationSequence.java | 47 ++ .../RemoveDuplicatesfromSortedArray.java | 16 + .../RemoveDuplicatesfromSortedArrayII.java | 34 + src/linearlist/RemoveElement.java | 15 + src/linearlist/RotateImage.java | 31 + .../SearchinRotatedSortedArray.java | 37 ++ .../SearchinRotatedSortedArrayII.java | 32 + src/linearlist/SetMatrixZeroes.java | 27 + src/linearlist/ThreeSum.java | 54 ++ src/linearlist/ThreeSumClosest.java | 37 ++ src/linearlist/TrappingRainWater.java | 35 + src/linearlist/TwoSum.java | 29 + src/linearlist/ValidSudoku.java | 47 ++ src/linkedlist/AddTwoNumbers.java | 69 ++ src/linkedlist/CopyListwithRandomPointer.java | 12 + src/linkedlist/ListNode.java | 11 + src/linkedlist/PartitionList.java | 24 + src/linkedlist/RandomListNode.java | 10 + .../RemoveDuplicatesfromSortedListII.java | 40 ++ .../RemoveNthNodeFromEndofList.java | 25 + src/linkedlist/ReverseLinkedListII.java | 22 + src/linkedlist/ReverseNodesinkGroup.java | 36 + src/linkedlist/RotateList.java | 48 ++ .../EvaluateReversePolishNotation.java | 44 ++ .../LargestRectangleinHistogram.java | 64 ++ src/stackqueue/LongestValidParentheses.java | 33 + src/stackqueue/ValidParentheses.java | 42 ++ src/string/AddBinary.java | 18 + src/string/Anagrams.java | 37 ++ src/string/CountandSay.java | 28 + src/string/ImplementstrStr.java | 42 ++ src/string/LengthofLastWord.java | 20 + src/string/LongestCommonPrefix.java | 24 + src/string/LongestPalindromicSubstring.java | 38 ++ src/string/SimplifyPath.java | 35 + src/string/StringtoIntegeratoi.java | 41 ++ src/string/ValidPalindrome.java | 51 ++ src/tree/BinaryTreeInorderTraversal.java | 45 ++ src/tree/BinaryTreeLevelOrderTraversal.java | 77 +++ src/tree/BinaryTreeLevelOrderTraversalII.java | 40 ++ src/tree/BinaryTreePostorderTraversal.java | 64 ++ src/tree/BinaryTreePreorderTraversal.java | 52 ++ .../BinaryTreeZigzagLevelOrderTraversal.java | 44 ++ src/tree/SameTree.java | 42 ++ src/tree/SymmetricTree.java | 20 + src/tree/TreeNode.java | 12 + 117 files changed, 2674 insertions(+) create mode 100644 .classpath create mode 100644 .idea/.name create mode 100644 .idea/compiler.xml create mode 100644 .idea/copyright/profiles_settings.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/scopes/scope_settings.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 .project create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 LeetCodeNew.iml create mode 100644 bin/linearlist/Candy.class create mode 100644 bin/linearlist/FourSum.class create mode 100644 bin/linearlist/GasStation.class create mode 100644 bin/linearlist/LongestConsecutiveSequence.class create mode 100644 bin/linearlist/MedianofTwoSortedArrays.class create mode 100644 bin/linearlist/NextPermutation.class create mode 100644 bin/linearlist/PermutationSequence.class create mode 100644 bin/linearlist/RemoveDuplicatesfromSortedArray.class create mode 100644 bin/linearlist/RemoveDuplicatesfromSortedArrayII.class create mode 100644 bin/linearlist/RemoveElement.class create mode 100644 bin/linearlist/RotateImage.class create mode 100644 bin/linearlist/SearchinRotatedSortedArray.class create mode 100644 bin/linearlist/SearchinRotatedSortedArrayII.class create mode 100644 bin/linearlist/SetMatrixZeroes.class create mode 100644 bin/linearlist/ThreeSum.class create mode 100644 bin/linearlist/ThreeSumClosest.class create mode 100644 bin/linearlist/TrappingRainWater.class create mode 100644 bin/linearlist/TwoSum.class create mode 100644 bin/linearlist/ValidSudoku.class create mode 100644 bin/linkedlist/AddTwoNumbers.class create mode 100644 bin/linkedlist/CopyListwithRandomPointer.class create mode 100644 bin/linkedlist/ListNode.class create mode 100644 bin/linkedlist/PartitionList.class create mode 100644 bin/linkedlist/RandomListNode.class create mode 100644 bin/linkedlist/RemoveDuplicatesfromSortedListII.class create mode 100644 bin/linkedlist/RemoveNthNodeFromEndofList.class create mode 100644 bin/linkedlist/ReverseLinkedListII.class create mode 100644 bin/linkedlist/ReverseNodesinkGroup.class create mode 100644 bin/linkedlist/RotateList.class create mode 100644 bin/stackqueue/EvaluateReversePolishNotation.class create mode 100644 bin/stackqueue/LargestRectangleinHistogram.class create mode 100644 bin/stackqueue/LongestValidParentheses.class create mode 100644 bin/stackqueue/ValidParentheses.class create mode 100644 bin/string/AddBinary.class create mode 100644 bin/string/Anagrams.class create mode 100644 bin/string/CountandSay.class create mode 100644 bin/string/ImplementstrStr.class create mode 100644 bin/string/LengthofLastWord.class create mode 100644 bin/string/LongestCommonPrefix.class create mode 100644 bin/string/LongestPalindromicSubstring.class create mode 100644 bin/string/SimplifyPath.class create mode 100644 bin/string/StringtoIntegeratoi.class create mode 100644 bin/string/ValidPalindrome.class create mode 100644 bin/tree/BinaryTreeInorderTraversal.class create mode 100644 bin/tree/BinaryTreeLevelOrderTraversal.class create mode 100644 bin/tree/BinaryTreeLevelOrderTraversalII.class create mode 100644 bin/tree/BinaryTreePostorderTraversal.class create mode 100644 bin/tree/BinaryTreePreorderTraversal.class create mode 100644 bin/tree/BinaryTreeZigzagLevelOrderTraversal.class create mode 100644 bin/tree/SameTree.class create mode 100644 bin/tree/SymmetricTree.class create mode 100644 bin/tree/TreeNode.class create mode 100644 src/linearlist/Candy.java create mode 100644 src/linearlist/FourSum.java create mode 100644 src/linearlist/GasStation.java create mode 100644 src/linearlist/LongestConsecutiveSequence.java create mode 100644 src/linearlist/MedianofTwoSortedArrays.java create mode 100644 src/linearlist/NextPermutation.java create mode 100644 src/linearlist/PermutationSequence.java create mode 100644 src/linearlist/RemoveDuplicatesfromSortedArray.java create mode 100644 src/linearlist/RemoveDuplicatesfromSortedArrayII.java create mode 100644 src/linearlist/RemoveElement.java create mode 100644 src/linearlist/RotateImage.java create mode 100644 src/linearlist/SearchinRotatedSortedArray.java create mode 100644 src/linearlist/SearchinRotatedSortedArrayII.java create mode 100644 src/linearlist/SetMatrixZeroes.java create mode 100644 src/linearlist/ThreeSum.java create mode 100644 src/linearlist/ThreeSumClosest.java create mode 100644 src/linearlist/TrappingRainWater.java create mode 100644 src/linearlist/TwoSum.java create mode 100644 src/linearlist/ValidSudoku.java create mode 100644 src/linkedlist/AddTwoNumbers.java create mode 100644 src/linkedlist/CopyListwithRandomPointer.java create mode 100644 src/linkedlist/ListNode.java create mode 100644 src/linkedlist/PartitionList.java create mode 100644 src/linkedlist/RandomListNode.java create mode 100644 src/linkedlist/RemoveDuplicatesfromSortedListII.java create mode 100644 src/linkedlist/RemoveNthNodeFromEndofList.java create mode 100644 src/linkedlist/ReverseLinkedListII.java create mode 100644 src/linkedlist/ReverseNodesinkGroup.java create mode 100644 src/linkedlist/RotateList.java create mode 100644 src/stackqueue/EvaluateReversePolishNotation.java create mode 100644 src/stackqueue/LargestRectangleinHistogram.java create mode 100644 src/stackqueue/LongestValidParentheses.java create mode 100644 src/stackqueue/ValidParentheses.java create mode 100644 src/string/AddBinary.java create mode 100644 src/string/Anagrams.java create mode 100644 src/string/CountandSay.java create mode 100644 src/string/ImplementstrStr.java create mode 100644 src/string/LengthofLastWord.java create mode 100644 src/string/LongestCommonPrefix.java create mode 100644 src/string/LongestPalindromicSubstring.java create mode 100644 src/string/SimplifyPath.java create mode 100644 src/string/StringtoIntegeratoi.java create mode 100644 src/string/ValidPalindrome.java create mode 100644 src/tree/BinaryTreeInorderTraversal.java create mode 100644 src/tree/BinaryTreeLevelOrderTraversal.java create mode 100644 src/tree/BinaryTreeLevelOrderTraversalII.java create mode 100644 src/tree/BinaryTreePostorderTraversal.java create mode 100644 src/tree/BinaryTreePreorderTraversal.java create mode 100644 src/tree/BinaryTreeZigzagLevelOrderTraversal.java create mode 100644 src/tree/SameTree.java create mode 100644 src/tree/SymmetricTree.java create mode 100644 src/tree/TreeNode.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..fb565a5 --- /dev/null +++ b/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..1537a1a --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +LeetCodeNew \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..217af47 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..db52d54 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..23a1a36 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..def6a6a --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..55b159b --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,620 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + + + + 1405605487886 + 1405605487886 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No facets are configured + + + + + + + + + + + + + + + 1.6 + + + + + + + + LeetCodeNew + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..ea09cdd --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + LeetCodeNew + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..7341ab1 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/LeetCodeNew.iml b/LeetCodeNew.iml new file mode 100644 index 0000000..12c81da --- /dev/null +++ b/LeetCodeNew.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/bin/linearlist/Candy.class b/bin/linearlist/Candy.class new file mode 100644 index 0000000000000000000000000000000000000000..9c8ae3814bfce5acb1de6edc8738bd60894c9049 GIT binary patch literal 805 zcmZ`$O=}ZT6g@BVCS#{blcr8%HR;F7)`ZDI$fhy~1tF3cu-Z*s^d%YFsrk@k5_BU7 z0k`fH(S;ynayK<@Nfz6}F&37Cirq^fLm zZP;n}{Tr&$_60K4UQ@OAR6o%ENl=DI!9eH!ox3eyHuVD3oBNfmij74qS;z=1{Mn|a z!lMLE!{Htsbzj$3SSw)lRTy*+**dmQ*Bq(#kUNNgkG|3DlY=oBb_9~Up=#c#sk_li z7P12NZg1Fc`d0$Iw;kQV)kCoXqIfPKMvFu#EqWztL2X`mhf{B(v`wkgAYh&{@wn0yO@{tu_5w>>8sf{>B+L3;C#W6E}v|c}?{ z5l!kgRw&Jgy-flOTt16AMs2K-YLOI6B)QFuN0OHrzlsd1Si(*Is|FnSSjIh~LY%>f z@rO8vN66tZ@_0i19IMgMZm};9b8<9oEfb|L|BT2i|AK`yC!gh!S1@K5ZROxbF^TKk qMrUQzJr`MH_Ruktvp}8r0o%f=h<`^?tcutopEl#<#@`EWK(nzW>!*l`j=Y26ZsKq-U%oPDbd_~Fu2?2+s5M(4IE+AFniq!vrGY5)lezWV~IOIU0nVp&U-tWEldvC_S zJovr_;4!=;;S=a8*d@!X6znx8Ia#h&velx5CeX2B-Zqm3v$UL?&8=9AjzD1CF4@k6 zfIk+W6VR@e^Hvysgd)%p5NOX3YNlGuS(TT~T)`rEro3nt=FEz%_Kic$dEH(U=+6At zb6P+yc|iymvH7W~c*c#R>ez*3hA~njl(m;jrc z2#%sXgb6$)@#J0&T?g6qHODGOa1~FJv~rc)7#@~gPTnApLpaMUrd4l06T!2X6bL$H z&j}kh)@Vu(&2t^bbv!RYy1j;Kg^J(>WY{UI3jII@|Baowv1+^-(L+*WflPsLmX~AE znzYsBiZrh4sOlA*V$y!zYjCC~1UO6XlKcvO^`RXEzv04%FlQwOf;hrC;wkXk#vPjv z?bPbv+J{aB;@gF$ti;$Zx?bHu_e|mr41X%HB?gVa2Z$z&z$k~7AN>?O405@Ul3V!G zkZSpf(vZ}U4GsLxCH9O6Bk;X3Sc zuNdzl-)G7A!({vs@;%9uDMT@gZoC2mIUIw9UcALe=WQIvyL@Qg#|eChllT~e_>!gn ziVw$+#Qlj#Kl81)i}Scg#6J+jeZ)l=Ln4ZV=)th)izyJ`e=W--LB$)QH{A?A6P z-G70$A^zxquj(G!MWT7KOO&N3%i?IA=}QSAahc<^>PK|{P5-@h^dr=i2=xc__eZ1m zk*(8ruqmV&Wxl@<^bz_B9w&^t4R6w=x+Mehhj3;Wg3UaZ@NXkM{Vkpt-o~|UJf|*+ z-@PPVOcJ=nImN<^(SO>dYtX~MG-fE*Se#jxu1-o7Nj^7Gb*;RUi#!pyL0unS{09LN BjrITl literal 0 HcmV?d00001 diff --git a/bin/linearlist/GasStation.class b/bin/linearlist/GasStation.class new file mode 100644 index 0000000000000000000000000000000000000000..b1d83e669f01ce3ca656ca059debc8e9b34a376b GIT binary patch literal 640 zcmZutJ#W)M7=F&av(vOCX~7f<85odK8YL2~vJ_c}2xy`JLs6G3y|`An;@Fja;TP~P z%F?L|3lkDUe*i201|-U3w^A2;zW4impXa@we}7y6*up~}jzEx@G}d`y3fp_Fi#@BY z$x0YAKqu#seaU59z@0m%B4F%lx#=d|YWQTDbE*6%c;0ZLwoc4A;o5uNj zJxyYP)o~W-WMAi|^sj@`elUf=+W5cVJM4;dI>=@xNo?bR$)mX;xZj=(C&P^)(T_CS zoe51DWd(C?F`o$t22^2n&WN&^)d^!pV3})0AK&Pc3g5?yKz%Qp=TZF1lq4HBn|I5l z@dzBrR{|VbT#eGF*P|BH>dAN1zE$ZuWtj#W7Acpm3aFRq3EV=1vTXhXS?Q4*x_#;P zmD~5u(P?c4Ubn-0cn}8a#_6lp7c2&zJYaG7*%N`cd2x36D^RDX1@auy`C6ft47wGz zN4h@g)_4|(T*o@&ZF1?5%~M9U84s~iRqtN0xn>HC&}63EWQ0{(4$m%b;|@1dc!_|P sLy*!hj-^YYc!S>)isKk@@=+W-In literal 0 HcmV?d00001 diff --git a/bin/linearlist/LongestConsecutiveSequence.class b/bin/linearlist/LongestConsecutiveSequence.class new file mode 100644 index 0000000000000000000000000000000000000000..afc3494b25ba2ebab74e6d791f0eeb37e6249d8a GIT binary patch literal 2206 zcma)+%TrTV9LK*WxydErA^{A7h!n&cbUZ7{O3VZ7=2XGL17b_)=x?!loVktcLe-j>tE2RABUo2uH*` zyyQg>dR3ekI94ulR=3tQ^r4^bQ~D#xG(@JHnYomJW0^yBJx^4sTSb7ncxV(h%r$FW zK=7>@-7Ncu~ft|!O(S4OOM~D5QUypSO0PS}(Vm=~{w zyy|*pjaRnmi0ml4F5r!(bD6j?oshS_h#4tV*M+dva)`PK3V_*=&r+Zpxz(pap}rF8P`K76rPXq-z{&8>TSQPeHVd= z9Yy$+-Z#$nGL>VT;2=Ofw-j^7K&Uu<(9`a#% zj4_Haj_+vkJ?Bp;?K4{bOh0>+ShnzOMgjIq;_a8j`xPPFu*G{(60fZwUN3$qjHYnE zAY&NuLo!MqHw!Yh!fVTTSqPujXbaiU((o2t4tQ9`Y+gy2>z>% literal 0 HcmV?d00001 diff --git a/bin/linearlist/MedianofTwoSortedArrays.class b/bin/linearlist/MedianofTwoSortedArrays.class new file mode 100644 index 0000000000000000000000000000000000000000..78686d51ed94fadd52db19f0f9fe4eeb141ed32c GIT binary patch literal 1599 zcmah|-A^1<6#rdzK6Zzt%hxPjy4Z?^?gzVDif(JESSU8x1iFpe5D5t~Far$C?vQ2B zH1V-XADWo>sPREf6JsQ4>H{^_5W}PYiaz^bn(FV)Zh#t%o1Jsdz4v_l&hMQ2>&u@G z0Zibwjt+rg&uutX({p!&(!684R>NPv_px8|n}K6bH=EY|T^))*_m=gMRr0LHMya~G z<*Wq)+6}ki22%o&Om;y)x#ioAfe2!8sL%uwa}0fFufFOu?^&y!BhWkNuUX!L)pX^) zeW(PR?ykVax&KEpDUe)u8+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c#0m+qDCV27OC3_NxOdLI=k=ZMoI5}L z{oMlqGgy{T1cn^DXqjcl-f~mtt#YB_nyy_cu2}C?tm3*Qp$W8KH@D4{V-`13%em{; zx+@SoWfyICK|qZs)&#V(rMwk}ickar1O?i%47*e*g$~^OVcHQ41xeQuFqzvFuXn zJUi^NV9P9!hI4pB;&p*8zn=%y5oAEl<)-K15Rzt=H&{#8Q-HDTtrG&_l~Sd=Zk@Be zVeM@iwZ~6k+RKAu#IN%G02(FEI(NxaieF9`0u%etzowud%-vIi4oA30>IVF_@Whcu z8+SS@GYsZgKaAZEFYPEbHLa=XKuo)GUz-hTX}O0;U(k^1>W&nKjP2I`P`%5y2PR^M z%xn27+MRTu>9m>FjDU6}t!wGf9y;h8n)wXD9bN2%gb_0I-P-R-LmK)rRl2rnX!G^Z zTK-n;uAkBHGR}OCa5ARl4Y~X{^>3ZsvrHuHRmA^gDaFF5Km{|RG~-3IfXl)!}F zjfa?|q!885m_m}B3gbsi^G;*@?}=uDn7i=+&*33D%?P9styY+XVKA@QQOy~JVBk37P-5Mkvn^tQArHBu2e zU?b5-vwp(oPp&>dB*QBKU>^eudk7Brfs+3K3+rvzTiD$uX1nJbLdzT-?X0?4;h_ zUd8<4H#j|2#cNMqMyH=|lB`X!(@8Qr?c*4(`{PYc0NJ4KBs;;M1m!GwR46Y}qhRSD DHL*r0 literal 0 HcmV?d00001 diff --git a/bin/linearlist/RemoveDuplicatesfromSortedArray.class b/bin/linearlist/RemoveDuplicatesfromSortedArray.class new file mode 100644 index 0000000000000000000000000000000000000000..7eb5fd76fb899fd7b63641f63846573304f7abe2 GIT binary patch literal 585 zcma)3yG|QH6g_u$?X``0h6DGC_(F4Nb=DAsJYE(RhtS&sWeO zDjJ$pky7{r@+J9+B%A?PG(lH7_cd4N+&jPi{u}~$kNFUupq7}PRyHyHtnpcQ(@VWO zxJXQ_GTlG5X}6WyOm}vyRaYSb!PJ?$RECuvYgdRb1H!##@<+&kxkah`ZEE2R7Dw#;IHV&mHRS1Xu$f z%o_AUpR4^q;rmm&M09O%V2oIPen3CYOfZ2-q8q+LKm#_S;SF;Bga0AezQ=sDP>(A0 zTa=?~Pb$m~uYFmFhIjvdSAs7O9Pr^tR!|`3sV1ZqP^3+;Ge_Db##LrcK<$}iB!G07 l!Zalmv5FbI;YMRv#4IBpZ~4B2ApFCxlxer?J61f*Jp$CHcPsz^ literal 0 HcmV?d00001 diff --git a/bin/linearlist/RemoveDuplicatesfromSortedArrayII.class b/bin/linearlist/RemoveDuplicatesfromSortedArrayII.class new file mode 100644 index 0000000000000000000000000000000000000000..44091e366fcad173d0f19778a888eaf587f0bd5a GIT binary patch literal 1315 zcmb7DTW=Fb6#mA$>-7zCF$p(25TL=%5*x~;G$t+y2+6|W7FUt1JWcE&EUdlOW*v$5 z{E9vm^&v03v=2#DPNlw=F}p{xtBrO+N@#XE6xm%UaEbDKPq6ZpgAHdu!#!>T}f& z1>$$yo*PyLj6!i)z`W;oR0;-?8CZx5jMSOr@u0h^f?wsTrv%39ep`CWGH|uNe`$u# z+;xFc{aY|qh$#31xPVnysTFGiVo@Nr!h_u&1cB-ite_U}4En@F#T7W#3}ySpBia81 zqbuE>z+_>i{+Vhs4BXyYrMR4eKvIjd863w*5_z1nF?FCW&6n$;>Sk~r)2xX~Oc5snNBD3a8M^aiT&l;I1t;$gHY zT!5o{a79}jelIR3P+}3zYs0Gr#20dxBfuR*^G&tzH4k@b2x#kn7}+Hafj~@a5{p0 zV+d^@HbK&7jKGsvqF0tg)3{6DEb|@5ZAQqF&Lnekn(RF!g%DHe80}Bu)IQ;NjA_#1 z$!Pp-s%4msmdRyt#jQrm=1RmH^*0c$9h`Qyac04&ZejW_q2CA6V-@Uk=8#& byd2C#Y>bFa8nHc;Y}^$hPa2DKiec%0@EsCL literal 0 HcmV?d00001 diff --git a/bin/linearlist/RemoveElement.class b/bin/linearlist/RemoveElement.class new file mode 100644 index 0000000000000000000000000000000000000000..837f8a14f0846efebdb2a96b763f05ed2d8958a2 GIT binary patch literal 530 zcmZ`#%PvDv6kYq?(}z;(QA&tNq$y3>0Wl#>L`a$x31VV&dYy2&ZRPgX7x)VUF)}eR zk{I*@{D`mcSf}lPfyv%`?X&k}y5hrY#wriw28wqUOIpZ=yG9sV{%>B3pHx>6O$w!k@Kp$yFuvrKrMFr;rH zpR31__OAE!%|I@7-0Fm$+4Fmb{v2AeH)09Ai2njOtau4yf~d?a%(2y1Bwu>ZDMtGY zE(|k{^aq&JM1oO_G1}#OC{h7=x8iQ7C*+D*RhoZ5y0~!XiUo&vO0ufhef<7dc;=)F z%RWbbO43RkNit;^ZEu+hR&l-0I#47(C&qg&@|eIR_Z-env2r=Nh%76GX>Ja|{X|k^ L++I1uhJ)M>GUi@O literal 0 HcmV?d00001 diff --git a/bin/linearlist/RotateImage.class b/bin/linearlist/RotateImage.class new file mode 100644 index 0000000000000000000000000000000000000000..d1851e5673fb68dff5fab4ded9acba8e387bc955 GIT binary patch literal 1422 zcmZuvU2hvj6g}ge_1N1@<0N%jsND}rgPo-|xR3&F475-bVOWHbC6lL3yd)deA9B_u zMdB^LfJfc}4-tBgqIE%?NuHZR^tH&g0JlJFl8`tnWIrN59BYRjg=#@WW!H8vjuTxc+ z6FC3>Zg+-3*!Bk&3Yb?Y9xom9vEkrF0d?OChrat6%NLf4Cs|v#j*^zUtTRsH#bydG zQwK zS9yH~Up8pj2uWJSU74%kYR>N=^#h#*ELsgSh%>bI*tapkozPE!mWM?)E(Cn(>@OO% zU3Bsbau=UE`ASxn7R-2ca#`7y?MlAn{^vS5+0M5sw8V7$sjZWh8p!MT6E|zR+frm@ z9N#(kcH0p7oEh#Me61N9G2>FqRdJW%mnKUKvy9D=e~rwWjI1!;Bl-YSadwS!l07r@ zWZKIR(L#NJY0OXy6A{kQGnn5-mY!tQI{z7B=Xqud@^7Ss_zR}^6V1mgmc|7r7|5hGVrk@zMrPBMi1PWICAeH;N>@ z@S+cpsNn9y^yU#in+ZrjdN z*EfBuRd+qgRnIf`btnSq9rKM@YMahhskXUeHGKi?mhISnSwPMg)&!KhZp%tQMmz-- zn!rGn(;x43HZAX&x!JY^hN^DUY_FM~9r(SV;&0nsf%)oxky#;bH>64nDgt6v zKw77v`KGsJk(;2ScInZUEvLm)$8NO(5`A^wY`%VE?*75=n6@J@oL{e=?^yRe+u2$v zti>^o2_4xB7pU)deXEngB&Imt-6Mz*HQR3K2|IoETV`h^0fBfRW>V5t+{qO5#AH z)ajL|1+}_xir5Dl5)za_8Z1asrlJDsK6)ZphLX)9y@9JyRPQ(DW)5nfIh%7)rr zR*QzZn0*V)P>+ifi-GqZv)Mo&Ad_Y29a4rGH5F)Vl#h@L^M^s+P*|Vr#p6*SM<4z= zkdBEchb$jrh;}^W93$5xIcCUmoE#^~GLJNFVi31kcZZpK7{&vP;5jbi1xB%fF}z|| zo7KUliLCuE2tvGx)z88LPmv=n}I&dut7NLS+6yeSgoO^wOT_<(~Bv!Mp{#A)sGna4AD5nbWuJ*?gX>v juhUO_Uqwh3LfG#P0s$k?6# zz&|i`(3{w5zINnkrU zXvh{|AT22N*#E_JJaEEYHSiq4N-r2HZ%>78>?c7zI&>$3dhb8wJmk%jxm+5X``vE+ zjX<^qsr@b^kqSo+)d?MALXWoQ_%>5x*S2FBOZ`X#XmM7eNw39Icp7)VBJ*XQ&Jp7@gUAyLiCw@FJ;5~;i6qM-woEg2rga)u zy4}`i7*{R*!0_5e!!nwca~S$%quPv}PqGxAAYc0uG#7k@rzmlU8O7QKV(ME)np@X1nq4rSskj!>oe4N7lQ{1%q+ z7$rPq_7yq1u<#nI7~v*7tRcWUrsSXE_Iv@I#gOb0FM#8cUz#uF3@hxB;&aMAW$MU~ iY0=X84se5LurpX^{z6{lCrVN?i>p5v7v2|tkF~!aP>JmT literal 0 HcmV?d00001 diff --git a/bin/linearlist/SetMatrixZeroes.class b/bin/linearlist/SetMatrixZeroes.class new file mode 100644 index 0000000000000000000000000000000000000000..c6529cddf532a0464a66242856ee65effe9678df GIT binary patch literal 788 zcmZ`%O>YuW6g`*ucod4XrGr8Nqj7WW*Dq7cGo{) zcU^Vu%ETCcfLr4qF#ZZ-#4`ikn3&Amcka3G+;{Gq`TFPc1VA0v6=H&X-yJ%(-*-nr zZO;jI?Z9{69yq?|j1+XiQqO*4*ZTJGRjt|SIo&{DK6Zz0uqDvSxAz756YqtSfQE%d z7%&Ct23tNG4?2$DvO9f8u+s3lc7NaY-7ue%dhpsE2?~w>J9s2m7&*br4i7H3+dJWr z<{+|32P7DM?^qy2X4mVF2Sb6H0rroz59pCQh{fgG6QuS6yL-56A4OIamKCys#GW_y zyUw;7T3-Fi7{f9sNHQ+YHgHWb6I?-> zkzzUKjySoK%4D;mtxvX!U-XB1fx*x=%nMYs4RwJ+#WL3|RXsyGr&~&I*~cDTRCLXGn&M`UfOuJ+$Vf>c^$(TWDHCX!=mB?UzpJ!+2W(_xyBU0Gm|2yNFxHaeUbbS}eDGN$L6xM{H az=t2|2zYtG`D6K+B4@GKXDE$S(9EoKB literal 0 HcmV?d00001 diff --git a/bin/linearlist/ThreeSum.class b/bin/linearlist/ThreeSum.class new file mode 100644 index 0000000000000000000000000000000000000000..1f9bdc97525b731a4c17cf59fa4feadf3030a0cf GIT binary patch literal 1790 zcma)7O>Y}j6g|(L@z}1@q)x{9C@v{&f>Rs2rI11#0ws_VaOwzGL1`qEi9L0v_#>K( ziy|ShiP#||B(@QSqOd_~yGToevSU-0m5^Y=f)(N)0K%L%V<(N31-9nR`?&YqbI-lc ze)R9dT>$4XufZqKTd``UVOOj*Cv)YxZJLEfRf8hXbHli4WGY6joXM};FpG{rVA85t z&Xj;ZF}5I}OxH_h7=DBzP!SO5&JpW!qq<_+SB#a4DG<%oi$-O^ur0Z6Z7R-nYfV7U z9TGY#5Oi8J1o{$7vtv1zNW-xznH*WtB2=)-HN$DxjF3IVWU|AhwRUrvtvP1dw6jzE zYUrf^`|uZS+gO(|!iXXiMhpWQ`rA^t3|y172nI1k0oLj^Wl<%Cg)pAN2@P?9WBbar zqDAmDh6S{nMx|lquL;Bw?Ys_93~<-itZ35F{R;^ zcG=tjh4nSZtVZxEUZYO+2DQ;WEUTWGCy+xp)2L=;JHH;mG~SSnSoea+Mr^gAhvtP2 zV+L<&xYX{UgHRF7;%zp^szmQ7+8%f2X4qw3hTcO`V}T5TaG~C?i{^|a?^9R%il$|M z;3Tv5^D=`YLm|LX<0`|q;9EU&AHlnv_z>nOkAWbLaEy2ce0OohhC?^4dN}vtm;~`< zpwJfha|hAI`{Q?@xCFV4zGOU|jJqD84ZqkzRc_FHSr2?gTe)?0f9rP3 z{Zfn6gf^(js1I=bdz|#)Juc%1R)pF+Obu$D6=BIDt}C~i?{BC=SChN9nyJ(srmMJ8 z*}To*Oo}BXic+9{N))F=BV0|O5A)Db;E%)t24L|Qp@JdQ>Gu(>KE?@r##{e6hVcdK zw8@+O9Zq2fr}2mgk1>j$@hpBpFMcEbA4s}odDoM?RThd*n*_@f#P1lx85XA>KhZYD zipTLIp5sg*uV0boOeOL|RzJm3Zz7Ac^w4mQnZ)SnVLZ>7cXpm7+ z)W}r!Mw5}Xy)D5HaC{&d{TtJNL2VMH!vP_T;{sh}2YyOcvNO;11bzrF`hEFDRmm>~ z)cm5xd9df7d~OGVZS_)e8!yk@LpHUIi`#fpcB|hlL6i_+T0=}|l>b*}Nmh35um_BH fkmG8Ig3P%Rjq=o!NG2@%+uM-|3tZ-&5BdK9i)4PR literal 0 HcmV?d00001 diff --git a/bin/linearlist/ThreeSumClosest.class b/bin/linearlist/ThreeSumClosest.class new file mode 100644 index 0000000000000000000000000000000000000000..a10e488f318488fdc5c477b998edd58cd6296ef6 GIT binary patch literal 1186 zcmZ`%Sx*yD6#i~!qqVGM%3=`}mzL4i1?y5YD$#_bh@pf8i3zu50)t&}Iwiqp68?ej zs0lB|L?3{t;RpDWjIn+*g%FHRa?d^6J?Hz*nIFHu9sszB`vyV+gJq{`OSkOQz0B;2 zYuklJWujcG+jY-?D$unm*JY+GtIL_`;;LQp1oUyI>Ua+Xlw@j7K%J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RP#t`&`=r7tf2#M*y$~A_6EDXM;IS)1)p#g zTZrH@y6}YzzB2wBdhipyLPnp^&@Y@AD9y&4ITOOootU#>di7+-*`e1!&jOdQvZs$a z@LG_mj~aOKi+tUjFF)%y(o?uQH@W*bR|Rs|!{({N9=7%e+d9C=rLwfD;2c}~QKiT` fs8-?NBeqd1v>#}+Z}a}rsaFmh^CmPg!Gh-BM=|h_ literal 0 HcmV?d00001 diff --git a/bin/linkedlist/CopyListwithRandomPointer.class b/bin/linkedlist/CopyListwithRandomPointer.class new file mode 100644 index 0000000000000000000000000000000000000000..88a2bd778a6f8f83af5b97ce8571ece8b68f6d76 GIT binary patch literal 322 zcma)%!AiqG5QhIrlg7qsiw__OQd$q@;8F2X=qaeE^u9@!cItLl(yiiSc`EeK2k@c9 z+2U33^8fSCFvB-r-`gF4EA&%Dgmc68Mc0N`J|DZ+k3x!f_VY(&YqxxGY`tz$#DxAr zy{X(NJIn9Og|0lIeZ!XhEul3WO$qVX)jC59oh}lz3B7`?zFRL#-8`$(Xu?V1DrKgs z;gEluv7hsbFev`Ra!tsd+`6gsgu}(tKdCPRFwP)&@-W0HV2P%Z@_h!9iwzDwr4b<$ V4P(f{p=ftsC*ntv2*;ukdOu3#O?UtR literal 0 HcmV?d00001 diff --git a/bin/linkedlist/ListNode.class b/bin/linkedlist/ListNode.class new file mode 100644 index 0000000000000000000000000000000000000000..7ceea83231d48d6764f7e244564d28f6ffc3ea9b GIT binary patch literal 367 zcmZutyH3ME5S+7(jg3PfAv{Dym!yabN)QbaQY0%WK<>}Z2`(JA|)!vV2UY`CJu^ zfV+}LK#T>vQmsk!(tp%f0{*owb#ueI{&Yudv%#KZFq6S2YJD=7zEVh0|PA473yccAo$%<+#5y{#z? N$oMoBIN54XzX21KKve($ literal 0 HcmV?d00001 diff --git a/bin/linkedlist/PartitionList.class b/bin/linkedlist/PartitionList.class new file mode 100644 index 0000000000000000000000000000000000000000..c3c1341301e64612eb856352f43411979b6df499 GIT binary patch literal 863 zcmZ`$+iDY06kVs8nUloC=2|l`-s&w;VniQ=RD@C}4aBsV67WTwBtv`J>7-01rQhRA zUll3^1z!bU{3Gi+lLR7EnAw-LFK6w&fBpIP1Hel>mRJ%fdCEU@hn^aTjU6WlRj5XO zo1TOrkU4NpoQCK4dyVb>fjbBVtk=p{;TwTiwbm0bHbz4?i5L^gnV709(m1IOz*fztjAG{Su~7AUv>_x_qd;&@I-pk7_f)C4#?#aFSAo!Gdd)sc8arnx4RQEK{;rtTQ7{Onpb@ee43c z&fI7k^`>bXP3vh>p5cWp&rz&=Lcum|`4zTpp2KdMXUN*t6tFZvTPtbHpO?RxYS7c! zmY}TD`5ckb1UHeTG?5_HJjtw(NSWR(BypFtYoz;}gkOkmImRB^p}cHcH%B0v~aQSd4G=*uMgUwOwwtLJnniU8QBQu8sS&Bp$Hu aDvV1e$0dYBM*oW+V5jw(A2M?ZkNyIq1EJgi literal 0 HcmV?d00001 diff --git a/bin/linkedlist/RandomListNode.class b/bin/linkedlist/RandomListNode.class new file mode 100644 index 0000000000000000000000000000000000000000..035d3087109c152ae2988727a254b8c8749250cf GIT binary patch literal 385 zcmZ`#%TB^T6g{^TkXix3XIQxd7P4@uabrS4(qN*d`)NDT!J$n`G5nSbW8%UO@S}{U zm5mE?Gxu@k-g6&c-yfdBRI7teb$LJt73Ae(j;33bmv*3n{Wl)g?dpFtJ25G zZM4vFA*fpwX)BPKz)kgr&>;AiQaxWUBb`5}$ZA0^$YNzfm76l&f^P9-Rvc&}@b0s99_y(olly-cIxly@ z8To5GK>65&8faptvaQMreGj|L^XX0DP>77*u{R#Pq5I0nL65p!vG7o=Yf<{dj()Ro Qu;uh{$S$0YKV{wV4;++9hyVZp literal 0 HcmV?d00001 diff --git a/bin/linkedlist/RemoveDuplicatesfromSortedListII.class b/bin/linkedlist/RemoveDuplicatesfromSortedListII.class new file mode 100644 index 0000000000000000000000000000000000000000..22d6b00b59e1bb69a54a8f37b981cfe42ff71fef GIT binary patch literal 1126 zcmb7C-%Aux6#lNx&giJL73j|A4QK+16>G!FIhMPWyH{C})j&X>wOu=y z6X;B5<^{ByUQI^PiS8I8&;@!6wku1GdPVvVt%@TB`U_swa^@}HR`;VvEm*eK1ttss zks@!%3K|$(7Goso6F{lo3v; zS_cVC=QHyvBgvcN5BiZ@Wt~q41W!L;;g++yc?E*YKcem(U1E`;t9vA4inEYfEQ%EWUM!2z31?3;T%5VJa&oS zXD^hjb4}@vWTl8WOST|Wp-nbo2p`BX*@j_ka+%C)6mQ8lnd1e<7>2HQ9byW)0b!u8 k^#f){;>>*%7n|)umJFfR-+dl$=`$w^<00@8Z3ogn0h80~SpWb4 literal 0 HcmV?d00001 diff --git a/bin/linkedlist/RemoveNthNodeFromEndofList.class b/bin/linkedlist/RemoveNthNodeFromEndofList.class new file mode 100644 index 0000000000000000000000000000000000000000..d1af0e4f2a34f4a83feae340c12d728ffd39355a GIT binary patch literal 795 zcma)4O-~b16g{_{>GTU)TB}xQ#03GI;4CCAKusf&h^ZwJ(*1P$v;)%_QwHMFg?~c- z0Na{qOkB8>#2@0?A3&_<4Q;{#6BqA(-*?Zs@BRGq?K^<`Xjn)ImI6OKRK37Iik+8g z5S^%Y+;2xcwLOdmPs3jHs>PHALr^|&Ph2N(!`IGk_dt2EAoI`<{rIsUy|UU77+Y-2 zBaK`UCNhFj%MVric+geDeYYDZL8TRWZqRXuzV;_UBkuc0g5}nKf!QRK;S}lwreJO5 za<>MpS#0jCUK!3|4pj>kLG{wiX;%@~P$QjCy(P)ol{YZmS8h)rAM;w%f2KNMIN)vU$oF|Y5vRFh8%gj22xlW)D z7<?hKOsgM%+(UIiWN6Wu95WBIJb!<&a1(|Ezaho iY*U`gSYxsv7UqOMUd(eCv}ZHtC{h=A**r^9SojN2?WX$x literal 0 HcmV?d00001 diff --git a/bin/linkedlist/ReverseLinkedListII.class b/bin/linkedlist/ReverseLinkedListII.class new file mode 100644 index 0000000000000000000000000000000000000000..24d0f92c644e3f596047d533d1dd1ed7a96c77af GIT binary patch literal 892 zcmaJ;+iDY06kR8oTVi6bPdRT5EXA(evl0s}DxD?y)RlAPLUZe=o4^}RpR zr@ksE1qDCAFYq_~fyQ+vQTkAXnX~s5i0hir1ab%7kyq_`gLl=P)`4t?0>&eM;D=iR$x^u~pgkFOWEx4NGSFcN z%&>@TME#ZwUU{va6qu_I+g`8f1-`mZK`q?(M*_?B|Et&(xEf5vZOibzlmmfE>0**n z+n|O`*DYU)o0t{IUwGzkMjAQfmFju6QF6=86oG3QTt|VxKz?Ai_N66B?@O;EAo~1W z{*+oJ6bNK@L$BR^;T=v#klr0eL0dle)sPC8te~Q%j}@>0 z_XZ^BamGAN-m0{MR$n`V^*N@~JQWQlT;Z9S1kh%A<0vu1lgUD=jS-8!BljkGhPj&N zXm`KDcC?zFTsKaUb@VT=Yx=PvY@?`kPR73-y=FK@j7~_ixNe=I3+@OvERXs)}W-Z)eoi%9ZSTK>}CsJcFDHB3n)ba1*7FMa?HZu}f{R0@Crf>iN literal 0 HcmV?d00001 diff --git a/bin/linkedlist/ReverseNodesinkGroup.class b/bin/linkedlist/ReverseNodesinkGroup.class new file mode 100644 index 0000000000000000000000000000000000000000..bf406f903b284999e8ed782ff89cfd767ecd7707 GIT binary patch literal 1250 zcmah|TTc@~7(GMx(k=xGxWGaI!3(`msxcv^Ai+pL0<95D6CaG(wi{R|+ol(y@BR?u zgMGzBCDFt;A@M)>7kt+k@Jw5ghbAWN%s1a{&N=h#x3f=Q0Ng=bN0-24(e?J7LeZ_( zl3UK9Q>i+cQo*UxyH+XH%Q_T+(4Kv0CyTbXlYErhbMiF-ZPE4I+LC}T63q%I4_IWt zhd>Z2G=aWN*K;!UgPc=&V&{sEz`$lHZx^$6#g*r_Q>pE`Re`C^|G-!f=&7{eZ8UKS zBqEoKHc3DNUs#WJbO+FnK^+4EgO{%QTNT6=m}KEOFUZa8*uh|jVaaZUiIMea)_}lh z5Mu}n=xuNU+0L*!w(RKajGuSzI(9)o?DM}apcd)}2QTR^^J+eWZ zJH}8Z5&wWtBBjJrY6FYPyw*UEr7|t0zS4xLh2Ow$si)^ZxPZZln59?>rutc;iHTn|SYXUquKToPZ3oo-yV!Q?h&5 zV$fy>c&s*?j6F+CiGLpQ`3hII6| ze!roLz%RPZpR5yd+S=;%vbUc#X-O)j%u0&V(kxAGdIQszW~mg<(iqbj&`;29>5Mk` zRi|`@mAB{LXDx+E@dTIIf8xZN4`~tDC?y#q{V;|}W|SbOxG$5`Dy>z+4EC zZc>$FkS1}HV5KEV``B|0H)$#Cyn-28D*NA~EGA>an5VcVg_V-bKso27ejVaMl*5}!zk0c5c>mp$m-(& literal 0 HcmV?d00001 diff --git a/bin/linkedlist/RotateList.class b/bin/linkedlist/RotateList.class new file mode 100644 index 0000000000000000000000000000000000000000..279872f0e85f42af6c0bb2d252275cdc51c126ac GIT binary patch literal 1799 zcmZuy-%}G;6#j0qKa#M>&mgfBL<^-gShUhou>llpDCk2MSYc(^&}HMakDc)! z>65RvV}ny>`pQiIi2e`tUFml=Y0;9|$-Up6d+s^kIp4jTKi~fT2Y_)rG7(cqd#=CZ zYnQvdn0IO}*VLRu2f9pjDs;UQ{@+~|x{)Sx-}!-&(@i6AdE2o!6_n549Lx3`e=FQp zFgL0};P~9BdCp@_%2i0N2adfXl;{~a`&Ew%t;?aku`_S)HA+tI1+E_o3x(e1_2kM) z4B)bf!S{N<{NsM;>{_^jA@;peWq@=klE$qR?n%_;kOX$8OytSv)GP?b85-u`FoR=8T zh=;}p$I$zYD zqcx+wM0-(t7FQ8EI{rI?`QOmqcfN0Lb5hqPjeOA*S5sWgXNF1}Y5nKp*L6c8V=8)Q z5-%ba!f1)NkTgl(;A0}er-j+ikZ+o(m$;t{2WZKW;Z?Nri`9WibmBU?aEtqAi0`5Y z_i+|0+#%IHs#nmcjBb_?aaCjVVSGTF&KyHHPh>FDAo{p! zGJX;t5+!hf8M>hxZ(u4D9m%)oR}o+aDqrs-eqzKJJqyn<_$w|QBDG`5%WN5_BBsfI5_u6QKZIi?2*#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/stackqueue/LargestRectangleinHistogram.class new file mode 100644 index 0000000000000000000000000000000000000000..ff5687971bcf18d856db1eca28bac06216ef9742 GIT binary patch literal 2042 zcma)6OKenC82--O*UWICE$y9BZEF#1r%c=7IUs!~AlT7q2PqbZy5Q1YXKtAnGk1uv zX35ILg~SaFv5A3&E((fiOe8K`n7AWxe;gwF4mly6HnQdtW)()IkTQ!%;p`pIPO-xQnq3j45$Ll^Y$e> zp66RUeSV%=0{VzsbiFYFCE7nNpdKsDIbkRWnb4pMG^O04Gg&K~cPgjt^La;LYpOJB z=cnz8E6+Hc%kfF_A7W+zC=y*V;6&!9p?fQjrOP3lBm~x*ua25 z%i49a=s8)Z5=IO|CgRvF5Oj;)w4JZ9Gb~{w zOdP}^38Plcu}`A^MzP+s0ZdvRHZd#{P|BsUz$Ty4@kWVT>R#3gLMp?)MzT2Pkd#o~ zu6hkQ=sAUQor}oEuDM)(+BvX3|w?L?w*%mI}WN0F<+ zQ=GftuI;*m;1?7E2y>Osyu>E1WOg@kIUmew_=p35clPD{Uw=FzK~u(a6njg<#i711Sy`<=JwOY!3m`H}fS zLXZ(c#1O_--n~d^J8=vU#XjDR^8EydTjCtAW1)t`DbEqK6KQ}N+t9&X#ZkOKNukaj z`s(0K6Nb=9Nuy5#U6gcm)4B!PV;Dj_Mp%d~ZGRJlkVMu~4;-YEAl074zDF>&d>xu{ zOBua~p3EJ*JlWU}tBNefXM;=FaUE^46cqcuMQjO!H_RW34QZq03M zd0jmE*DS5`CjD!^|4&vP_=KrGVORX3S*%ioWNae^9k5vJZWebZ*AdokoZo^e(wD^! z%=5N@UR*&Rt|5w#_>KFRcc1br_&N96q~j|L;y&$vBw0UUFMcNFzjFT#`|&3Z;4j`k z!Xcmh_ZgXNtdjqvLH=g^(IDTV?Fbu2A(~$>MoA@>+kQi6#B&y}`Q%@tr`IVNj8m61 z9HH+B8>sH%=&FyS^dXz2A7)6bFpzFQ7&yj%4}YAY_Kru0h`#oRhy)%Yw1Y0+!0~z$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8MJ)?21`~Vq6exQL*8hs^&%*!! literal 0 HcmV?d00001 diff --git a/bin/string/CountandSay.class b/bin/string/CountandSay.class new file mode 100644 index 0000000000000000000000000000000000000000..57524e7e66cd8c4859ffb3f0584b6d487ef8672e GIT binary patch literal 1439 zcmZuwTT>EY7=AujSfup?Vr5cUX^19aW(Ung%QQhP8cVxrg;m!OoON-gyDt16jooIZbwRQ7xelLr`v@38Obd7k(EzWx336~Hw-R^bu|Y}%HYUx|$uig{bl zXVdyC6^cO9n!csSaym`3OKV2P7Vr+6dD9*da7Vi51(fkZ*6_oPIt?Cp1saoP-k2$_ zFB#SoeJN)!d9skvbMv}o%6sLbVy~K;0xikv%0mJtG7?C_0U{8JOm!y@kfa@~Lq0SM zh`1jDK@BYk2{f!2wnJgeST0yB-4&^htC5O%^88QnPfUU87#d80`n0WQUZ(U7hl7gn z5rN9Ed^jfnKibiu;Q}sFu$+-!u~!|zrlg@$Ll-X7kXhBO1SM6-Z(K#Uz{%q*$BJey zYgjU@M?){J2&h|nu4v3IA7fYU&rl6^enb$H-MK2ItR~kzFFpD-PQw6E=^GnHJ}b~( zOZ5t#AsI0!BW_5?@#?CF9dBv44R+OM7s?{B?~&>ddU!2kvzVhKVvVw_>n7XM8hKs| za~%?(Xk$lv@M_aG)-~M2ed=8(GE=A=Y!+g39C4cf41JyW1?qg5WXX6u-rvtLdWfWo zX%3UqgQNZ$Qc^w7hDqhx{RH289$cIvIA$>51kYO8fqOk~9CtKwmBFv+t#CgTXi6y~yU?P&B?MC2 zZV^7Sv;VXA9c^wWUn@(p2yb5a7~8$t@qC&!JZMH6zqxUS zS^RMQflo!d@X?Deu!810?Xt>Z;B3lGG}B?_#h|ha@3taBN>2&r-=euET*9TEkizxN z{*OIG7J5H}-1|aGI9o#8v6pbYgqx|5qGU%T85z5?|M3u?sKctB6&uK>k;*jj*Nh<7 zDA!5iO40U=T%?8rWn}+3E;`I4$EO&sa7f%{S8&PT7RLFx{cs& wg>`~CWCMdAFuDh^@Cg%v2kb%#QwQy&WOQjmfGH1J8pI4{`CVX+s|%0*0h;C_c>n+a literal 0 HcmV?d00001 diff --git a/bin/string/ImplementstrStr.class b/bin/string/ImplementstrStr.class new file mode 100644 index 0000000000000000000000000000000000000000..023ab16acf202427f3f62ec123505d959a2ada47 GIT binary patch literal 1096 zcmZuvO-~b16g{sq)0R5WTA1?XfKrdG>{r4F=?K^;FEX5EJ$aMU+>+KXud;3ji z&+&Zbn|?b6RUox%zqJcZo8?M%*Qxme(KXj|{i1-9%Wny&>#e$zfPw)X8lnQpvg)8BNFA@f(4dl7x@y7{j-E9H%bL5-z`zz~H7tKeP9He#JsJ?n{#MI_@IJL$!w8 ze#|>jIdz@qb}3}PMOzb_t!}&KJauKuk^gS?o}7;v5X@%)Mj@|`F~+RGRdCf7z9RmG zKM^DtWm!URFzO+I>mW0MAtV{);m<^?T$imgq>i9328(8$UdcZ|6Q>p{nW7mv4ifVW z6Q?|;1f#Nu^Iv1zC{k=Y#r!ra^Bit*=n^ZE#zHu%M?*g7DNF~{mWiJxm3b1JL6&{* z5FdwZ|LiZLi7L;9nby_RDkgt(0eqJpWa z+jkxhdkx2bsv2EKkg9r3)vYVv)%pHrIOw)Nu|Ly1dtTyMjb5 zP|a75)aGw5J>~WV*}{wCoyB?_7jfCdrNipp3<9TT;|dli${SKaX433>C;kvn-0_e5Gt^0 z-q3G44_$p|nWNvslBU503JCG*0i);xXEd3WxeC`vX&12%d@x`!>avEOV6-Oyt_fzM zO)%=_ZKA_mi=hXLBP7GED~x2@Z`3<`Ls_ zgae`+Y$D5i7IEZAndjaDX*79hLaB9P*h{>yxtf8A~F3+^x)xcdulCa`e; literal 0 HcmV?d00001 diff --git a/bin/string/LongestCommonPrefix.class b/bin/string/LongestCommonPrefix.class new file mode 100644 index 0000000000000000000000000000000000000000..ad2e64ecffe41fe61d8d189d96b337899fdd60a5 GIT binary patch literal 1184 zcmZ`%+fEZv6kVsC>5ZviOS!b52r4bDR9Zl#SX2^|nj$1MB*dpF3}vtv(oPM&^AkR5 zOn5~fN}`bu(BJUUAMgQjooNjrl!w{p?6Yrct=T{Remwz@#xpk@0^x>LH>;&&zE&+6 z4Qshpsnn`#bz|GycS8~A+tuId$+FIr)#9$PX$iO%&8lf-1)R~?x`47=+cJD`!mB}r zOQ1JzR*jdg9F4Zc4xNs8~B@LtrF-HG+&luzVSqz-07w{v24r zrjUtUe)8bD0DK4{{G|b}x%WF+;La2?gDL=w26S28|4LdJ~+va|_Y3~N}#V*zzfR$L*V+$z0Z zqE3RJuTX2&H;w0}T&1Bdi#jdG;1=OKx!Is)f4FGf^pZTe1W>1r;rYyqg9`yWEK_@U z*V+j@{q%&CfL0d&hQdrBA3sq(!WHN{iaS#)O7;-xgmbioz=ER8tA~ihLuzVRX<_I+ zG)9yy#*PkD5mMtPAI^RqIK^n9g^^EZKNCmn=d>|Q+tVdf7rdP3hX(=P!ixV#0wir;9epB4PxUM$#@I*SH2)cQV-8X4X_C4 kCxj3p95aqV8}wMa6|#g1M*BOUBP6zDgBEzghyzdm0i2rhC;$Ke literal 0 HcmV?d00001 diff --git a/bin/string/LongestPalindromicSubstring.class b/bin/string/LongestPalindromicSubstring.class new file mode 100644 index 0000000000000000000000000000000000000000..65d38bc675ddc144077558acc8dd07dc96593978 GIT binary patch literal 1490 zcmah}O>7%Q6#m9LyJI`s*0DQop)Ry(Y3-WS#BNL>Z6Q=bSTapTOjPOv+1N|6!9S6` zL2xQUk+^a~;zWytj5yIAT!~7(At7!YICJ2_4XNs>f`)I`siHIy$l5n=-rs!hn>YUD z@sIZbl<q1x>%yM6zv)ABmaUbpQv=GT`-J_RX|Sam*f3N44Bb4#mk z!xykFcpcBbBw%E73j*?Tx9P@VAZEjaC2*kXb=)iK?IpKYbCz1JK(g9xIIRVz=LP#M zqx4t2zQD=q|09_Z7;ilVlx0t4tJ~=2!+vIRyG?P7Bc+hs(ab2^#zAOy)N(t^{z}+U zMd1*Ydi{Ek_l%8aafA_#6{k1L=4G~$yBv6q+ISAn3&i?Q_!3BGE0sL}2naTs+>MNm z3cnBddHhxdRNMLZeWDRC`@YlTf&1otr}5$2&RR&D!Wn@`{W^iP9gkt@Y<+j#+(Haz z@sdJeXV0JXeYb663PpC)wm(9{w0gND3 zGHz_78nw|%XGTkHY1NdA-ypH2m8Di?b3+NOv~_Fq#)c)dMbv9~ZSp4WaqLUb(t z55`5f-6Vpj0^Q?bh!A{+3OTXK)TbRr;1I@XH4%A4u42gJ#nDt@HXKnPbqAC8Al|!+ iQu5po_jOT*7O#3z8j-^6bBDjwBxd literal 0 HcmV?d00001 diff --git a/bin/string/SimplifyPath.class b/bin/string/SimplifyPath.class new file mode 100644 index 0000000000000000000000000000000000000000..8f1c1325c6135e40c06f27b7bd71ab607f165c65 GIT binary patch literal 1657 zcmZuxT~iZR7=BLJupzDx7Q%<$h)N=m^%FmWw1sL*8xV~RMQ!U6R#>`8w#mjBZXIWw z@xmD|^`bMq;?{Z*W~Afvx__eoMEacFP?Er8a`v3}yzg_K=Q;20Kc7E-0&p3YijY80 z#VgyzRU>N`T*rR8v0!>@Dind(y7|mB9Fu!@m)EVlC(u4=7j17!pe>Qi2`DqA6)TE1 zbZ7{pU7#yt7p?hfVc9A_Fqa)mK+lx&rjs+vwp`bPinnH01mc+kj!p|`l?EyT=MtGc zCRv|sI=Md-LAQV~qUb?fMQ;=Tph`m@`US!j>ZF*FgK!`12UamiWj=+fXFEpLGxNVj zF@O$v)-esoae~%3R&mu^^R1bU;FLfpm68dkH4Nhn6Rh8=rXyuHo*OuuPCk@?=QNBU zL55br^)`GcKYm`rD8{&UORhj~qEUSvAc7Rt^S}XI&~Oo#csp*jLOxCQ?H<>l@_&FU z0#Gp_(BEqJbk%lNta21rab4c@jTRBRmy(kiX$_OOMZKo$TE!KC@kYJ7sSN~zQ2mUw zg!n?km-tE`;+2BUR?&47sgd0(yR4Nm+enyf?gQ>qc7VJ>f$pGe?^b1%&HpUvm#s?G zVVm?dckqV0+r?*Ft0(ufm?Gj~zhUM~*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;MC$?_76!Gf)V>(N~{tMO^5V1dZyCFBB0TD350 z9FZB_%1a-9*xs{1!0wZuee%=K1v^=)SUKZ_DHnFf|Nb!Sk;9H1Bs<7o6tD^`8^Zjm zJf-+w$lIPLh&-eaK#X7c3^ZU3znZJS|7&^T_CO=G)=>_iNjedKQHt{X{W6*_KEe92 z#P108K3GO8PaDRS0VSDO!o~nDcnU+I`=|s5!nI>?K)sKN1uZ)i?Bg6r&VSjf|0^?I;&eODE&YOC_~iwC{&kn5l|OcYBP68Pf9z1{~z zt2miXV>%ni?7NYFvV%1rfQXY5=!r5j5}lo9Womn zg+9XANArFsaS01-6t{h(R82hUB`(3sCX0}w!;s*GT!gjo=bTRcli?L=PO!O@hwZH8 zq`3bbwqPWCBC1 zWt#jBvnq!$PH?i4JuZw|LK9v>god|Smw*K6q!x7Q;?9q}$&dQ3e`igCAoPA7_)CV56R7eNHi{tdr1wH#BbHecDEu_M+38&FI5zN&#AS a;R8xR+BG?;DYewxn+%f@_>lGieDoiu3S5`~ literal 0 HcmV?d00001 diff --git a/bin/tree/BinaryTreeLevelOrderTraversalII.class b/bin/tree/BinaryTreeLevelOrderTraversalII.class new file mode 100644 index 0000000000000000000000000000000000000000..ca4e4726d1ef1462d785197c8cdfa1565a464bcf GIT binary patch literal 1678 zcma)6&u<$=6#mA)#&)(z^TTf4LYfpOIB8s`Eu=IKF8x8M!AU3yK~!8e_9WeQS*M%b zpm5?)q+UUs;DG3*h*OY|N{ECwfy9Y_2UJ?VSv$$rLTY7scHX@AzW3hu-prqmfB6-_ zIlM0s5y*S4Ql-n5W4c>Q+}6~lvKQQja+h3lQ@I5O$=IW|)1u}(JIw9W6V>cvDJcUl4Z>vTt_+ShDq=A=^XH(XjwoT(go0l+< z#Hhfbfb~84QW!zOz!=8a)lHM0qMF78PD>O8dV^%cR2V2>Qb5wwR|~5G*+MlOX^*ik zoW&~==LEVB3f2i5cvaUMH5&~b`@DhIaDi#tYLye#)6raQQZ_K7P2#S#cGJ_q6%BGR zi2XloEo-tb8Murq#NDtyDTB;{`WIAnB-2+8SYzJz8X+9{R2Iy}>^pg4J9+@8}7f40#3#&2$h|VTL0iqY!+! zeVk)Xz@lf?Z_k0~H$MIl z$sYrCnyXd=DRgl)S_b?cqQvv<8068=bo>GQ=u~1~j84f1SSapbSl~B|Oeb^kT=FNp{4?lyhK^dA z`W=16VABG-n-E%>-aDS&KfWtPMrLB)J=va!=HfeeJ&H_%S?u5qfv=z3o7iTyG3ZKH zaFnZoB&#!6TQ@7qvaTE-iDC3(90MrwMVRF21suUe+P_Wh4IHEIaX5Sq?qCpGIDyYG zgnP94k~jMs*2#7TR literal 0 HcmV?d00001 diff --git a/bin/tree/BinaryTreePostorderTraversal.class b/bin/tree/BinaryTreePostorderTraversal.class new file mode 100644 index 0000000000000000000000000000000000000000..daa9c1507fc8d2717bc6c3694d84f37f5efcede7 GIT binary patch literal 2357 zcma)7-*XdH6#j0r>9%2MOMgKSA!(r`P1`7-lq3`ZMXPD46pMhrw(XKGq)BG8f$1y0 zIn4OvI6OE!DX-{A>)08`8E49jf0KiL=Wd$*AS#p0=Ipumob#RUJNM?#=fD02;3RIF zXieAX#RpyZ}#OC=tX8{Aq&7Ci5C?&3B9G^PXp~-ljR?BY9)Uu?h5b0diVeI9$9Gq3ic(YQmCGc!b5~pBxX4Bn z`kF?v>P~)FDw`Y+Hw$Rqn?mkoa5fK4&b1?sK@$TCd$pdMnpilBgVKO=%a=Vv7LJP} z?74*{?MYe~MvBvP*Dflk$p}V~HZi8KZ)^7I8d!J@uPd0`T5~SnV&{p;y68Kk5 z?_rWuI?EM*MIT2t6spLSn+rA1b4r|po*zL>hn!E{aGL~((BuwAj z27lJ~+)^Q%oQqJ?D{}B>xszhh!ReRBoQ2cqY{$pAVdDCZn`CyS>O0F8ZsHRHF4wk3 z+bySOnAvB3$6n4x@EN`^@%iSd+qrDP#ymT$NW{NLEEkmR6?oC~G{G;`OQb90-zzhb zzr>qFAu?O8c?-@ZSMIL(e_fGdqA?j@241Zo4a|a8K25%*`K!b`yoRF1`a(KihhDdsaWCUL zblzAHQ_st2L~)S$+xU3}hnW3U#!L0UbC@0_S68F@5ncTO^GNl<)CS_ish<&(;$j@r zC}<>p0nHQFq(MUi>L&-_2{h0{NWJJs9|o9O8V-OBHh>M*fw9CcV1Y+~y~(%`)Bq83 zq8bP_Kk7c;Te;!UCO@fX2#-8b(<)=EW1N&_GT~@AwTkSu$MB-zRh;`B@r)5Q*v&KS zk>6t*h>mVxO#4Q^hozmPKj6@aSeq?M@WpFUWBM_Y^{|d;SX+`_jMxV1u9$W);?l#v zA85G(cCL^Skp4CtCJRR>Sd8+-$<+Xb8RX|EhH#8G-4Nz@SuP*}7fBR(O_ni&d%Pd- zV+>z$zP{n!@A#K4%uWO}G?;zVko?;^vt9Ta?{f@7tn~mN&@x!@OXM*{#bhA*NoE^l zzwjQcO><2Yh{F5}9VWV;W50>G{*Fic4s`Rc50^1Rb!6!OV0w{1yN>vEV+|kX#R$`w z5~G#IbZX=&=V$aOV(U;;=qlCuC}aEtQn-pwWs-u?9@g`8ngzx=PiKfLL$u=5PgX%0>WrODYMbF_2K(PQ6D{%+A~VTKqAnu8Num!n`bjzZu$Opn46<6GeV E171G${r~^~ literal 0 HcmV?d00001 diff --git a/bin/tree/BinaryTreePreorderTraversal.class b/bin/tree/BinaryTreePreorderTraversal.class new file mode 100644 index 0000000000000000000000000000000000000000..d9789a28f2a80abfeeda4fb7d9c85a80e853ba13 GIT binary patch literal 2170 zcma)8jZzy`6#gz**d#6`n!qxLtLuinC)mYmRwfIW@DSLsN)6Fb~XZ$t>??SGFEl+pa>-oL#ovd4)hc zv96#kRCcT|0tgxCMvp>Y!7f|N_5CfzGPg>WLVuyMZI;$e$Ch)$sJVM~O(9nJKO8xQ zi`8~;3RmO4r(jbPOmAbjT4#KSE(BL=8NP=M;jca22k#C+rB))6uC^sBT{yD+*j94~3zQo=kdP z+{5arz{ySyovA6zJq^yz&WZI9#xSlUrqJsZ^Ry%eUcwdj$$?o?Q28*fA)zDAdY*Mv zLtg_)q!e^sty?SiNh_Xj6!csfMC*)!31k`9+}WWn@s?`&J(^406-ZMCrg2FGwC=lN zxMARBF?2ij?j9xWExP9R=Sya_(UQZbb!)zXylXk8TXA&UWNFT7?>UAsBXys_oPpQC z2ccE#wLPyh&-k4p`X@;7e8a#k+$NQ3rK&I(Z>8MulxuGqcnfz3+}f|Yhu+J(%TrC@ zQ_Yq_d%)QAv3A>BTVKudlD2Q!Ws&+`3%a7~*yY_^Vm(a7mgG$@^Cqi710Rzt?-_U% zeIXR_fsVCvL!x+CbFF;?>)0U7O8u;H?Mil)kzK~O%>7&#o4BWgH2f!Z{bP_cebrNwv46G{}_G~Qb7v90Gyei z3JiiCt~yUy{wlF1j}iQun=XX8%4b=h;cEC7_}j~q!Ugp4R)qU5T=atMF|-7aoS=X6 z7=ug6RQd=*>4&rhym%M9?;!+vy1=LschvW3#HBZeaf$JR{CgfRF#3zUCE0z;2rWv+ zQZxHyFZ-8_BiYAOKVvMN`WB<#;p!368%gdb1&C~}%SH%l9-t^S0EuW!8zGHhzQ!1a zT7Zo=fsHqSF-03N-y*LsL$+DL#O4`V`MT9GcB0Y zsUzez1b89!_{nbs{rZm>D+qxC4+~#C`JMJ(Ga{|eWSTfZgh7fIA-+LM7p1r{);!KN zgUguW__~QJn8yh6oLwS+(udS!x!9C{0dM0Sk3!Dl8}JGdr6maYmT!I=A!lLUi@=|V z>X^~dAB`Y{cdm&!|G-mm~fpEOxr^YAvl&28C leCD-SKN2vx>tcjaY;hOhw~)tHYqp(l8KF)J+w||k&fg1?)2;vj literal 0 HcmV?d00001 diff --git a/bin/tree/BinaryTreeZigzagLevelOrderTraversal.class b/bin/tree/BinaryTreeZigzagLevelOrderTraversal.class new file mode 100644 index 0000000000000000000000000000000000000000..e060e2220c90e607e253558ebf4c72b3d85c565a GIT binary patch literal 1800 zcma)6-%lJ>6#nk+471BlOZl1>IWM(x29%3s^uJc^h^w+iAyL9A+?( z_|_K_-}J%yq|t;YlbRU&gT(k$qc6sPhg9*qGYd>NCX&t0+;i?Z-}&x$&fGu#dG-r{ zQQR>Q6Uce4l=*9R&2rc0xm>iX8&*Q7J!R-`-cT5Hl>wHyPQz>#~_nw58~S~Wkj zbWfH&ftI3Ov%Lv{cy3@pK)YVA$X3LWG@+wKpsi%rSfDWuv}Z& z4X5VawO0iOO9$mMPBt4&WCeP1A%Hr{G?|PKlmg1WXFK_lz3MS7IcHaEmgl?Va_j%% zi%t0rJCI{%gkP+x=+Pxt^_9;~w$rQ49#lUf@ zwI6fam%cP{0w)FZ`tq`L1=6{YPNW0l1B(Vuy@XE1@5@S9ygNkiHSsE5V|!NWj>F(w zLzgI!fqsEQf&RPlCDDhRi2)3qO8T^5AeaHJ*c`vtK^L+ap^+m(*Ul z?$?-RmVMWiH81#r1X7CCe0^3Grg)12iJJVR5i4xE=+3*rdw@Irl|^BJk0MakVJ}4GYsJS5G_s(+6Z!l>loSBb94*`i?GfELn!OguKUuS`$0ma z6KU<+ov((ndWe}e3Yscr#5bXl7&%-K_-3qUy%ltBrhM95HtEG6jS zEi;Ht45JI@d8LeUr--AR@?)4{#4L_OGT+BZe2Q*-hEw>QSzn?T-|%Yqj2J$yBNN-ki7R58qy;`8Knx520*{rXA^-pY literal 0 HcmV?d00001 diff --git a/bin/tree/SameTree.class b/bin/tree/SameTree.class new file mode 100644 index 0000000000000000000000000000000000000000..cb69ca876ed068e21dd8f2b65340b351ab5ddeab GIT binary patch literal 1245 zcmZ`&Sx*yD7(JIR)7GhMrO2kTcclopLV3?!NupCIu!8TEYA83uV;t8A+uSZzcI+Xo(JBjQh1PoQGhoy^dVV@PMR!62jma|& z;?K&omI~EU*1T`Ypu_Iq#)K96DX53v7q}Ax{M@x#(45GT2g%8V>rQcl;`Lnx_1!~vzKPC zZSsnTi$y$k<0zYg#RFU+u0BGzLkI%oYP}gP0m8Ppf-W1}UBIw8{W@1aIMnlSV1yNupBMwCfH zR5AaO(kN^Mx literal 0 HcmV?d00001 diff --git a/bin/tree/SymmetricTree.class b/bin/tree/SymmetricTree.class new file mode 100644 index 0000000000000000000000000000000000000000..fb2326a3952116c00f6ac41259c0518241515070 GIT binary patch literal 781 zcmZXR&2G~`6ot>kj@>v;hl(tM*Y4 z8y=t=Bm@!*mLTy^h%@7mMNpJGbLZYU=bP)_f4=_!@EkiXN&<~MQ>r_>nM_ok#nB-% z7q&ofDz9WWk<*jz+tI0taslT>JdN|00@iN(NWgxTzEd77RD6`-2-N%WR1GdCBb6P> zQKBf`Pa~Ne$t>3S?9k4~@r6LM|G)FTKsCOY!%$$i=+amN+U>WGD_Fs*i-thW2>dJg zXkv|2iF!}g`ocYZYu(2k-BQltlX31r;GU2Bc)*irtfDi4twp;9mG&_WvNWYZZJ5jG z>_DEIS84f8A6t0L>0HS~K)ey~hUsM%sn@ZY#r#>C_?aFr``ONq0Y*~5VRV^wxeBi3 z@Eevsb5nxHsLQ&w%IFsjTx-k(mQiQam#^7jb6wy2g|dCS_XWWLLu(Lro_@vMTb3*% z*PpmBxdpy!$Yjmpvn`@nLq(=aGcb7WE6#_<1}X!A6d{(>ye_; zDM)_8)jLZwZFKnmgzZrCao-}^2Q+osVj7r~_|_t?Ps$qkm(k#po8-{r*euNEygfsy W$JH~GB}3`J_FNGXahsJAp8N%JyobC1 literal 0 HcmV?d00001 diff --git a/bin/tree/TreeNode.class b/bin/tree/TreeNode.class new file mode 100644 index 0000000000000000000000000000000000000000..d8e4d7ad66822e29adb71d6679d9e5f2841e0c6e GIT binary patch literal 352 zcmY*Uy-ve07(6Fw)0m_!&~`yJ@jEAvbbF9Pzu+*FyK7)y@+ykA(`IH$79|Jh4 z$w89^Yl%JbLRJ$vJVeIth{k7c=)baaFktL9Djj$Tcq9&p9sja%xYLw4;w$vUiQPN- E0TTr~=>Px# literal 0 HcmV?d00001 diff --git a/src/linearlist/Candy.java b/src/linearlist/Candy.java new file mode 100644 index 0000000..5642d24 --- /dev/null +++ b/src/linearlist/Candy.java @@ -0,0 +1,32 @@ +package linearlist; + +public class Candy { + public int candy(int[] ratings) { + int value[]=new int[ratings.length]; + for(int i=0;iratings[i-1]){ + crt++; + value[i]=Math.max(value[i], crt); + }else{ + crt=1; + } + } + crt=1; + for(int i=ratings.length-2;i>=0;i--){ + if(ratings[i]>ratings[i+1]){ + crt++; + value[i]=Math.max(value[i], crt); + }else{ + crt=1; + } + } + int sum=0; + for(int i=0;i> fourSum(int[] num, int target) { + List> list = new ArrayList>(); + Arrays.sort(num); + int b, c; + for (int i = 0; i <= num.length - 4; i++) { + if (i!=0 && num[i] == num[i - 1]) + continue; + for (int j = i + 1; j <= num.length - 3; j++) { + if (j!=i+1 && num[j] == num[j - 1]) + continue; + b = j + 1; + c = num.length - 1; + int leftValue = target - num[i] - num[j]; + // duplicate deal + while (b < c) { + if (c <= num.length - 2 && num[c] == num[c + 1]) { + c--; + continue; + } + if (b > j + 1 && num[b] == num[b - 1]) { + b++; + continue; + } + if (num[b] + num[c] < leftValue) { + b++; + } else if (num[b] + num[c] > leftValue) { + c--; + } else { + List newlist = new ArrayList<>(); + newlist.add(num[i]); + newlist.add(num[j]); + newlist.add(num[b]); + newlist.add(num[c]); + list.add(newlist); + b++; + c--; + } + } + } + } + return list; + } + + public static void main(String[] args) { + int[] a = {0,0,0,0}; + List> list = new FourSum().fourSum(a, 0); + // for(Iterator iter=list.iterator();iter.hasNext();){ + // + // } + System.out.print(list.toString()); + } + +} diff --git a/src/linearlist/GasStation.java b/src/linearlist/GasStation.java new file mode 100644 index 0000000..e2ff635 --- /dev/null +++ b/src/linearlist/GasStation.java @@ -0,0 +1,19 @@ +package linearlist; + +public class GasStation { + public int canCompleteCircuit(int[] gas, int[] cost) { + + int sum=0; + int start=0; + int total = 0; + for(int i=0;i=0?start:-1; + } +} diff --git a/src/linearlist/LongestConsecutiveSequence.java b/src/linearlist/LongestConsecutiveSequence.java new file mode 100644 index 0000000..295fabc --- /dev/null +++ b/src/linearlist/LongestConsecutiveSequence.java @@ -0,0 +1,75 @@ +package linearlist; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * 方法一: + * 使用一个map来记录是否出现 + * 对每个元素,往两边搜索是否出现 + * 提交上去会超时 + * + * 方法二: + * + * @author luo + * + */ +public class LongestConsecutiveSequence { + public int longestConsecutive(int[] num) { + Map hashMap=new HashMap(); + int maxLength=0; + for(int i=0;i hashSet=new HashSet(); + int maxLength=0; + for(int i=0;in) + return find_kth(B,n,A,m,k); + if(m==0) + return B[k-1]; + if(k==1) + return Math.min(A[0], B[0]); + + int middleA=Math.min(k/2, m); + int middleB=k-middleA; + if(A[middleA-1]B[middleB-1]){ + for(int i=0;i=0;i--){ + if(num[i]=0;i--){ + if(num[i]>firstflag){ + secondIndex=i; + break; + } + } + swap(num,firstIndex,secondIndex); + for(int k=0;k<(num.length-firstIndex-1)/2;k++){ + swap(num,firstIndex+1+k,num.length-1-k); + + } + } + public void swap(int[] a,int i,int j){ + int temp=a[i]; + a[i]=a[j]; + a[j]=temp; + } + public void reverse(int a[]) { + for(int i=0;i=A[start]){ + end=middle-1; + }else{ + start=middle+1; + } + + }else{ + if(target>A[middle]&&target<=A[end]){ + start=middle+1; + }else{ + end=middle-1; + } + } + } + return -1; + } + + public static void main(String[] args){ + int A[]={4, 5, 6, 7, 0, 1, 2}; + System.out.print(new SearchinRotatedSortedArray().search(A, 0)); + } +} diff --git a/src/linearlist/SearchinRotatedSortedArrayII.java b/src/linearlist/SearchinRotatedSortedArrayII.java new file mode 100644 index 0000000..60bbc69 --- /dev/null +++ b/src/linearlist/SearchinRotatedSortedArrayII.java @@ -0,0 +1,32 @@ +package linearlist; + +//多分一种情况 +//A[start]==A[middle] +public class SearchinRotatedSortedArrayII { + public boolean search(int[] A, int target) { + int start = 0; + int end = A.length - 1; + while (start <= end) { + int middle = (start + end) / 2; + if (A[middle] == target) + return true; + if (A[start] < A[middle]) { + if (target < A[middle] && target >= A[start]) { + end = middle - 1; + } else { + start = middle + 1; + } + }else if(A[start]==A[middle]){ + start++; + } + else { + if (target > A[middle] && target <= A[end]) { + start = middle + 1; + } else { + end = middle - 1; + } + } + } + return false; + } +} diff --git a/src/linearlist/SetMatrixZeroes.java b/src/linearlist/SetMatrixZeroes.java new file mode 100644 index 0000000..f212f59 --- /dev/null +++ b/src/linearlist/SetMatrixZeroes.java @@ -0,0 +1,27 @@ +package linearlist; + +public class SetMatrixZeroes { + public void setZeroes(int[][] matrix) { + int row=matrix.length; + int column=matrix[0].length; + boolean columns[]=new boolean[column]; + boolean rows[]=new boolean[row]; + + for(int i=0;i> threeSum(int[] num) { + List> list=new ArrayList>(); + Arrays.sort(num); + int b,c; + for(int i=0;i 0 && num[i] == num[i-1])continue; + while(bi+1 && num[b] == num[b-1]){ + b++; + continue; + } + if(num[b]+num[c]leftValue){ + c--; + }else{ + List newlist=new ArrayList<>(); + newlist.add(num[i]); + newlist.add(num[b]); + newlist.add(num[c]); + list.add(newlist); + b++; + c--; + } + } + } + return list; + } + public static void main(String[] args){ + int[] a = {-1, 0, 1, 2, -1, -4}; + List> list=new ThreeSum().threeSum(a); +// for(Iterator iter=list.iterator();iter.hasNext();){ +// +// } + System.out.print(list.toString()); + } + +} diff --git a/src/linearlist/ThreeSumClosest.java b/src/linearlist/ThreeSumClosest.java new file mode 100644 index 0000000..6626037 --- /dev/null +++ b/src/linearlist/ThreeSumClosest.java @@ -0,0 +1,37 @@ +package linearlist; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class ThreeSumClosest { + public int threeSumClosest(int[] num, int target) { + Arrays.sort(num); + int b, c; + int closer = num[0]+num[1]+num[2]; + for (int i = 0; i < num.length; i++) { + b = i + 1; + c = num.length - 1; + // duplicate deal + while (b < c) { + int currentSum = num[i] + num[b] + num[c]; + if (Math.abs(currentSum - target) < Math.abs(closer - target)) { + closer = currentSum; + } + if (num[b] + num[c] +num[i]<= target) { + b++; + + } else if (num[b] + num[c]+num[i] > target) { + c--; + } + + } + } + return closer; + } + + public static void main(String[] args){ + int[] a = {1,1,-1,-1,3}; + System.out.print(new ThreeSumClosest().threeSumClosest(a, -1)); + } +} diff --git a/src/linearlist/TrappingRainWater.java b/src/linearlist/TrappingRainWater.java new file mode 100644 index 0000000..7f4250c --- /dev/null +++ b/src/linearlist/TrappingRainWater.java @@ -0,0 +1,35 @@ +package linearlist; + +public class TrappingRainWater { + public int trap(int[] A) { + + int maxIndex = 0; + for (int i = 0; i < A.length; i++) { + if (A[i] > A[maxIndex]) { + maxIndex = i; + } + } + int water=0; + int peak=0;//record the max height of left of the node + for(int i=0;ipeak){ + peak=A[i]; + }else{ + water=water+peak-A[i]; + } + } + peak=0; + for(int i=A.length-1;i>maxIndex;i--){ + if(A[i]>peak) + peak=A[i]; + else + water=water+peak-A[i]; + } + return water; + } + + public static void main(String[] args){ + int[] A={0,1,0,2,1,0,1,3,2,1,2,1}; + System.out.print(new TrappingRainWater().trap(A)); + } +} diff --git a/src/linearlist/TwoSum.java b/src/linearlist/TwoSum.java new file mode 100644 index 0000000..9c2ee26 --- /dev/null +++ b/src/linearlist/TwoSum.java @@ -0,0 +1,29 @@ +package linearlist; + +import java.util.HashMap; +import java.util.Map; + +public class TwoSum { + public int[] twoSum(int[] numbers, int target) { + Map hashMap = new HashMap(); + int[] result = new int[2]; + for (int i = 0; i < numbers.length; i++) { + hashMap.put(numbers[i], i + 1); + } + for (int i = 0; i < numbers.length; i++) { + if (hashMap.containsKey(target - numbers[i])&&i!=hashMap.get(target - numbers[i])-1) { + result[0] = i + 1; + result[1] = hashMap.get(target - numbers[i]); + return result; + } + } + return null; + } + + public static void main(String[] args) { + int[] numbers = { 3,2,4}; + int target = 6; + int[] r = new TwoSum().twoSum(numbers, target); + System.out.print(r[0] + "," + r[1]); + } +} diff --git a/src/linearlist/ValidSudoku.java b/src/linearlist/ValidSudoku.java new file mode 100644 index 0000000..1c34183 --- /dev/null +++ b/src/linearlist/ValidSudoku.java @@ -0,0 +1,47 @@ +package linearlist; + +public class ValidSudoku { + public boolean isValidSudoku(char[][] board) { + boolean used[] = new boolean[9]; + for (int i = 0; i < 9; i++) { + setAlltoFalse(used, 9); + for (int j = 0; j < 9; j++) + if (check(board[i][j], used)) + return false; + setAlltoFalse(used, 9); + for (int j = 0; j < 9; j++) + if (check(board[j][i], used)) + return false; + } + for (int r = 0; r < 3; ++r) + // 检查 9 个子格子 + for (int c = 0; c < 3; ++c) { + setAlltoFalse(used, 9); + for (int i = r * 3; i < r * 3 + 3; ++i) + for (int j = c * 3; j < c * 3 + 3; ++j) + if (check(board[i][j], used)) + return false; + } + return true; + } + + public boolean check(char ch, boolean[] used) { + if (ch == '.') + return false; + if (used[ch - '1']) + return true; + else{ + used[ch-'1'] = true; + return false; + } + + } + + public void setAlltoFalse(boolean[] flag, int n) { + for (int i = 0; i < n; i++) + flag[i] = false; + } + + public static void main(String[] args) { + } +} diff --git a/src/linkedlist/AddTwoNumbers.java b/src/linkedlist/AddTwoNumbers.java new file mode 100644 index 0000000..4b55549 --- /dev/null +++ b/src/linkedlist/AddTwoNumbers.java @@ -0,0 +1,69 @@ +package linkedlist; + +import java.util.Stack; + +public class AddTwoNumbers { + public ListNode addTwoNumbers(ListNode l1, ListNode l2) { + + if (l1 == null) + return l2; + if (l2 == null) + return l1; + ListNode head = new ListNode(0); + ListNode current = head; + int carry = 0; + while (l1 != null && l2 != null) { + int sum = l1.val + l2.val; + if (carry == 1) { + sum += 1; + carry = 0; + } + if (sum >= 10) { + carry = 1; + sum -= 10; + } + ListNode t = new ListNode(sum); + current.next = t; + current = current.next; + l1=l1.next; + l2=l2.next; + } + while (l1 != null) { + int sum = l1.val; + if (carry == 1) { + sum += 1; + carry = 0; + } + if (sum >= 10) { + carry = 1; + sum -= 10; + } + ListNode t = new ListNode(sum); + current.next = t; + current = current.next; + l1=l1.next; + } + + while (l2 != null) { + int sum = l2.val; + if (carry == 1) { + sum += 1; + carry = 0; + } + if (sum >= 10) { + carry = 1; + sum -= 10; + } + ListNode t = new ListNode(sum); + current.next = t; + current = current.next; + l2=l2.next; + } + if (carry == 1) { + ListNode t = new ListNode(1); + current.next = t; + current = current.next; + } + return head.next; + } +} diff --git a/src/linkedlist/CopyListwithRandomPointer.java b/src/linkedlist/CopyListwithRandomPointer.java new file mode 100644 index 0000000..3f8008b --- /dev/null +++ b/src/linkedlist/CopyListwithRandomPointer.java @@ -0,0 +1,12 @@ +package linkedlist; + +public class CopyListwithRandomPointer { +// public RandomListNode copyRandomList(RandomListNode head) { +// for(RandomListNode cur=head;cur!=null;){ +// RandomListNode node=new RandomListNode(cur.label); +// node.next=cur.next; +// cur.next=node; +// cur=node.next; +// } +// } +} diff --git a/src/linkedlist/ListNode.java b/src/linkedlist/ListNode.java new file mode 100644 index 0000000..f37b54f --- /dev/null +++ b/src/linkedlist/ListNode.java @@ -0,0 +1,11 @@ +package linkedlist; + +public class ListNode { + int val; + ListNode next; + + ListNode(int x) { + val = x; + next = null; + } +} diff --git a/src/linkedlist/PartitionList.java b/src/linkedlist/PartitionList.java new file mode 100644 index 0000000..dd61336 --- /dev/null +++ b/src/linkedlist/PartitionList.java @@ -0,0 +1,24 @@ +package linkedlist; + +public class PartitionList { + public ListNode partition(ListNode head, int x) { + ListNode smallHead=new ListNode(0); + ListNode bigHead=new ListNode(0); + ListNode smallCur=smallHead; + ListNode bigCur=bigHead; + ListNode current=head; + while(current!=null){ + if(current.val stack=new Stack(); + for(int i=0;i stackHeight = new Stack(); + Stack stackIndex = new Stack(); + + for (int i = 0; i < height.length; i++) { + // case 1 + if (stackHeight.isEmpty() || height[i] > stackHeight.peek()) { + stackHeight.push(height[i]); + stackIndex.push(i); + } else if (height[i] < stackHeight.peek()) { + // case 3 + int lastIndex = 0; + while (stackHeight.isEmpty() == false + && height[i] < stackHeight.peek()) { + lastIndex = stackIndex.pop(); + int tempArea = stackHeight.pop() * (i - lastIndex); + if (maxArea < tempArea) { + maxArea = tempArea; + } + } + stackHeight.push(height[i]); + stackIndex.push(lastIndex); + } + } + + while (stackHeight.isEmpty() == false) { + int tempArea = stackHeight.pop() + * (height.length - stackIndex.pop()); + if (tempArea > maxArea) { + maxArea = tempArea; + } + } + return maxArea; + } + + public static void main(String[] args) { + int[] height = { 2, 1, 5, 6, 4, 3 }; + System.out.print(new LargestRectangleinHistogram() + .largestRectangleArea2(height)); + } +} diff --git a/src/stackqueue/LongestValidParentheses.java b/src/stackqueue/LongestValidParentheses.java new file mode 100644 index 0000000..6e00309 --- /dev/null +++ b/src/stackqueue/LongestValidParentheses.java @@ -0,0 +1,33 @@ +package stackqueue; + +import java.util.Stack; + +public class LongestValidParentheses { + public int longestValidParentheses(String s) { + Stack stack = new Stack(); + int max_len = 0; + int last = -1; + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + if (c == '(') + stack.push(i); + else { + if (stack.empty()) { + last = i; + } else { + stack.pop(); + if (stack.empty()) { + max_len = Math.max(max_len, i - last); + } else { + max_len = Math.max(max_len, i - stack.peek()); + } + } + } + } + return max_len; + } + + public static void main(String[] args){ + System.out.print(new LongestValidParentheses().longestValidParentheses("()()")); + } +} diff --git a/src/stackqueue/ValidParentheses.java b/src/stackqueue/ValidParentheses.java new file mode 100644 index 0000000..02b0132 --- /dev/null +++ b/src/stackqueue/ValidParentheses.java @@ -0,0 +1,42 @@ +package stackqueue; + +import java.util.Stack; + +public class ValidParentheses { + public boolean isValid(String s) { + Stack stack=new Stack(); + for(int i=0;i= 0 || j >= 0; i--, j--) { + int a1 = i >= 0 ? (a.charAt(i) - '0') : 0; + int b1 = j >= 0 ? (b.charAt(j) - '0') : 0; + int digit = (a1 + b1 + carry) % 2; + carry = (a1 + b1 + carry) / 2; + result.insert(0, digit); + } + if (carry == 1) + result.insert(0, '1'); + return result.toString(); + } +} diff --git a/src/string/Anagrams.java b/src/string/Anagrams.java new file mode 100644 index 0000000..83b792a --- /dev/null +++ b/src/string/Anagrams.java @@ -0,0 +1,37 @@ +package string; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class Anagrams { + public List anagrams(String[] strs) { + Map> hashMap = new HashMap>(); + for (int i = 0; i < strs.length; ++i) { + String s = strs[i]; + String orderS = getAscOder(s); + if (hashMap.containsKey(orderS)) { + hashMap.get(orderS).add(s); + } else { + List list = new ArrayList(); + list.add(s); + hashMap.put(orderS, list); + } + } + List resultList=new ArrayList<>(); + for(String s:hashMap.keySet()){ + if(hashMap.get(s).size()>1){ + resultList.addAll(hashMap.get(s)); + } + } + return resultList; + } + + public String getAscOder(String s) { + char[] achar = s.toCharArray(); + Arrays.sort(achar); + return new String(achar); + } +} diff --git a/src/string/CountandSay.java b/src/string/CountandSay.java new file mode 100644 index 0000000..e62127a --- /dev/null +++ b/src/string/CountandSay.java @@ -0,0 +1,28 @@ +package string; + +public class CountandSay { + public String countAndSay(int n) { + String s="1"; + for(int i=1;i=needle.length()) { + pos = i - needle.length(); + return haystack.substring(pos); + } else { + return null; + } + + } +} diff --git a/src/string/LengthofLastWord.java b/src/string/LengthofLastWord.java new file mode 100644 index 0000000..300185e --- /dev/null +++ b/src/string/LengthofLastWord.java @@ -0,0 +1,20 @@ +package string; + +public class LengthofLastWord { + public int lengthOfLastWord(String s) { + int l=0; + for(int i=s.length()-1;i>=0;i--){ + if(s.charAt(i)==' '){ + if(l>0) + break; + }else{ + l++; + } + } + return l; + } + + public static void main(String[] args){ + System.out.println(new LengthofLastWord().lengthOfLastWord("a ")); + } +} diff --git a/src/string/LongestCommonPrefix.java b/src/string/LongestCommonPrefix.java new file mode 100644 index 0000000..a2d9066 --- /dev/null +++ b/src/string/LongestCommonPrefix.java @@ -0,0 +1,24 @@ +package string; + +public class LongestCommonPrefix { + public String longestCommonPrefix(String[] strs) { + if(strs.length<1) + return ""; + String firstString=strs[0]; + for(int i=1;i<=firstString.length();i++){ + String prefix=firstString.substring(0, i); + for(int j=1;j stack = new Stack(); + + for (int i = 0; i < a.length; i++) { + if (a[i].length() > 0) { + if (a[i].equals("..")) { + if(!stack.empty())stack.pop(); + } else if (a[i].equals(".")) { + continue; + } else { + stack.push(a[i]); + } + + } + } + String result = ""; + if(stack.empty()) + return "/"; + while (!stack.empty()) { + result = "/" + stack.pop() + result; + } + return result; + } + + public static void main(String[] args) { + String s = "/../"; + System.out.println(new SimplifyPath().simplifyPath(s)); + } +} diff --git a/src/string/StringtoIntegeratoi.java b/src/string/StringtoIntegeratoi.java new file mode 100644 index 0000000..3c37464 --- /dev/null +++ b/src/string/StringtoIntegeratoi.java @@ -0,0 +1,41 @@ +package string; + +public class StringtoIntegeratoi { + public int atoi(String str) { + if(str==null||str.length()==0) + return 0; + int num=0; + int sign=1; + int n=str.length(); + int i=0; + boolean hasInteger=false; + while(str.charAt(i)==' '&&i'9'){ + if(hasInteger==false) + return 0; + else + break; + } + if(num>Integer.MAX_VALUE/10||(num==Integer.MAX_VALUE/10&&(str.charAt(i)-'0')>Integer.MAX_VALUE%10)){ + return sign==-1?Integer.MIN_VALUE:Integer.MAX_VALUE; + } + num=num*10+str.charAt(i)-'0'; + hasInteger=true; + } + return num*sign; + } + + public static void main(String[] args){ + int a=new StringtoIntegeratoi().atoi("+-2"); + System.out.print(a); + } +} diff --git a/src/string/ValidPalindrome.java b/src/string/ValidPalindrome.java new file mode 100644 index 0000000..a5f83cc --- /dev/null +++ b/src/string/ValidPalindrome.java @@ -0,0 +1,51 @@ +package string; + +public class ValidPalindrome { + public boolean isPalindrome(String s) { + + if(s==null||s.length()<=1){ + return true; + } + int start=0; + int end=s.length()-1; + while(start inorderTraversal(TreeNode root) { + + ArrayList list=new ArrayList(); + if(root!=null) + inorder(root,list); + return list; + } + + public void inorder(TreeNode root,ArrayList list){ + if(root!=null){ + inorder(root.left,list); + list.add(root.val); + inorder(root.right,list); + } + } + + public ArrayList inorderTraversalIterator(TreeNode root) { + + ArrayList list=new ArrayList(); + Stack stack=new Stack(); + if(root==null) + return list; + while(root!=null||!stack.empty()){ + while(root!=null){ + stack.push(root); + root=root.left; + } + root=stack.pop(); + list.add(root.val); + root=root.right; + } + return list; + } +} diff --git a/src/tree/BinaryTreeLevelOrderTraversal.java b/src/tree/BinaryTreeLevelOrderTraversal.java new file mode 100644 index 0000000..78a0db6 --- /dev/null +++ b/src/tree/BinaryTreeLevelOrderTraversal.java @@ -0,0 +1,77 @@ +package tree; + +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +/** + * 层序遍历 + * @author luo + * + */ +public class BinaryTreeLevelOrderTraversal { + //迭代的方法 + public List> levelOrder(TreeNode root) { + + List> list = new ArrayList>(); + if (root == null) { + return list; + } + Queue queue = new ArrayDeque(); + int count = 1; + queue.offer(root); + List currentLevel = new ArrayList(); + while (queue.size() != 0) { + int newcount = 0; + currentLevel = new ArrayList(); + for (int i = 0; i < count; i++) { + TreeNode t = queue.poll(); + currentLevel.add(t.val); + if (t.left != null) { + queue.offer(t.left); + newcount++; + } + if (t.right != null) { + queue.offer(t.right); + newcount++; + } + } + list.add(currentLevel); + count = newcount; + } + return list; + } + + //递归的方法 + public List> levelOrderRecursive(TreeNode root) { + List> list = new ArrayList>(); + traverse(root,1,list); + return list; + } + + public void traverse(TreeNode root,int level,List> list){ + if(root==null) + return; + if(level>list.size()) + list.add(new ArrayList()); + list.get(level-1).add(root.val); + traverse(root.left,level+1,list); + traverse(root.right,level+1,list); + + } + + public static void main(String[] args){ + TreeNode t1=new TreeNode(1); + TreeNode t2=new TreeNode(2); + TreeNode t3=new TreeNode(3); + t1.left=t2; + t1.right=t3; + List> list=new BinaryTreeLevelOrderTraversal().levelOrderRecursive(t1); + System.out.println(Arrays.toString(list.toArray())); + + + + } +} diff --git a/src/tree/BinaryTreeLevelOrderTraversalII.java b/src/tree/BinaryTreeLevelOrderTraversalII.java new file mode 100644 index 0000000..62bc0f3 --- /dev/null +++ b/src/tree/BinaryTreeLevelOrderTraversalII.java @@ -0,0 +1,40 @@ +package tree; + +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +public class BinaryTreeLevelOrderTraversalII { + public List> levelOrder(TreeNode root) { + + List> list = new ArrayList>(); + if (root == null) { + return list; + } + Queue queue = new ArrayDeque(); + int count = 1; + queue.offer(root); + List currentLevel = new LinkedList(); + while (queue.size() != 0) { + int newcount = 0; + currentLevel = new LinkedList(); + for (int i = 0; i < count; i++) { + TreeNode t = queue.poll(); + currentLevel.add(t.val); + if (t.left != null) { + queue.offer(t.left); + newcount++; + } + if (t.right != null) { + queue.offer(t.right); + newcount++; + } + } + list.add(0,currentLevel); + count = newcount; + } + return list; + } +} diff --git a/src/tree/BinaryTreePostorderTraversal.java b/src/tree/BinaryTreePostorderTraversal.java new file mode 100644 index 0000000..55a78be --- /dev/null +++ b/src/tree/BinaryTreePostorderTraversal.java @@ -0,0 +1,64 @@ +package tree; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.Queue; +import java.util.Stack; + +public class BinaryTreePostorderTraversal { + + //二叉树后续遍历,递归方法 + public ArrayList postorderTraversal(TreeNode root) { + ArrayList list = new ArrayList(); + postorder(root, list); + return list; + } + + public void postorder(TreeNode root, ArrayList list) { + if (root != null) { + postorder(root.left, list); + postorder(root.right, list); + list.add(root.val); + } + + return; + } + + //二叉树后续遍历,迭代方法 + public ArrayList postorderTraversalIterator(TreeNode root) { + ArrayList list=new ArrayList(); + if(root==null) + return list; + TreeNode pre=null; + TreeNode current=null; + Stack stack=new Stack(); + stack.push(root); + while(!stack.empty()){ + current=stack.peek(); + if((current.left==null&¤t.right==null)||(pre!=null&&(current.left==pre||current.right==pre))){ + list.add(current.val); + stack.pop(); + pre=current; + } + else{ + if(current.right!=null) + stack.push(current.right); + if(current.left!=null) + stack.push(current.left); + } + + } + return list; + } + + public static void main(String[] args) { + TreeNode one = new TreeNode(1); + TreeNode two = new TreeNode(2); + TreeNode three = new TreeNode(3); + one.right = two; + two.left = three; + ArrayList list = new BinaryTreePostorderTraversal() + .postorderTraversalIterator(one); + System.out.print(list); + } +} diff --git a/src/tree/BinaryTreePreorderTraversal.java b/src/tree/BinaryTreePreorderTraversal.java new file mode 100644 index 0000000..69ac02a --- /dev/null +++ b/src/tree/BinaryTreePreorderTraversal.java @@ -0,0 +1,52 @@ +package tree; + +import java.util.ArrayList; +import java.util.Stack; + +public class BinaryTreePreorderTraversal { + + public ArrayList preorderTraversal(TreeNode root) { + ArrayList list = new ArrayList(); + preorder(root, list); + return list; + } + + public void preorder(TreeNode root, ArrayList list) { + if (root != null) { + list.add(root.val); + preorder(root.left, list); + preorder(root.right, list); + } + + return; + } + + public ArrayList preorderTraversalIterator(TreeNode root) { + Stack stack=new Stack(); + ArrayList list=new ArrayList(); + if(root==null){ + return list; + } + while(!stack.empty()||root!=null){ + while(root!=null){ + list.add(root.val); + stack.push(root); + root=root.left; + } + root=stack.pop(); + root=root.right; + } + return list; + } + + public static void main(String[] args) { + TreeNode one = new TreeNode(1); + TreeNode two = new TreeNode(2); + TreeNode three = new TreeNode(3); + one.right = two; + two.left = three; + ArrayList list = new BinaryTreePreorderTraversal() + .preorderTraversalIterator(one); + System.out.print(list); + } +} diff --git a/src/tree/BinaryTreeZigzagLevelOrderTraversal.java b/src/tree/BinaryTreeZigzagLevelOrderTraversal.java new file mode 100644 index 0000000..b85efbb --- /dev/null +++ b/src/tree/BinaryTreeZigzagLevelOrderTraversal.java @@ -0,0 +1,44 @@ +package tree; + +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +public class BinaryTreeZigzagLevelOrderTraversal { + public List> zigzagLevelOrder(TreeNode root) { + List> list = new ArrayList>(); + if (root == null) { + return list; + } + Queue queue = new ArrayDeque(); + int count = 1; + queue.offer(root); + List currentLevel = new LinkedList(); + boolean leftToRight=true; + while (queue.size() != 0) { + int newcount = 0; + currentLevel = new LinkedList(); + for (int i = 0; i < count; i++) { + TreeNode t = queue.poll(); + if(leftToRight) + currentLevel.add(t.val); + else + currentLevel.add(0,t.val); + if (t.left != null) { + queue.offer(t.left); + newcount++; + } + if (t.right != null) { + queue.offer(t.right); + newcount++; + } + } + list.add(currentLevel); + count = newcount; + leftToRight=!leftToRight; + } + return list; + } +} diff --git a/src/tree/SameTree.java b/src/tree/SameTree.java new file mode 100644 index 0000000..d4627c2 --- /dev/null +++ b/src/tree/SameTree.java @@ -0,0 +1,42 @@ +package tree; + +import java.util.Stack; + +public class SameTree { + public boolean isSameTree(TreeNode p, TreeNode q) { + if (p == null && q == null) + return true; + + if (p != null && q != null && p.val == q.val) + return isSameTree(p.left, q.left) && isSameTree(p.right, q.right); + return false; + } + + public boolean isSameTreeStack(TreeNode p, TreeNode q) { + + Stack stack = new Stack(); + stack.push(p); + stack.push(q); + while (!stack.empty()) { + p = stack.pop(); + q = stack.pop(); + if (p == null && q == null) + continue; + if (p == null || q == null) + return false; + if (p.val != q.val) + return false; + if (p.left!=null||p.right!=null) + stack.push(p.left); + if (q.left!=null||q.right!=null) + stack.push(q.left); + if (p.left!=null||p.right!=null) + stack.push(p.right); + if (q.left!=null||q.right!=null) + stack.push(q.right); + + } + return true; + + } +} diff --git a/src/tree/SymmetricTree.java b/src/tree/SymmetricTree.java new file mode 100644 index 0000000..7484c9c --- /dev/null +++ b/src/tree/SymmetricTree.java @@ -0,0 +1,20 @@ +package tree; + +public class SymmetricTree { + public boolean isSymmetric(TreeNode root) { + if(root==null) + return true; + TreeNode left=root.left; + TreeNode right=root.right; + return check(left,right); + } + public boolean check(TreeNode left,TreeNode right){ + if(left==null&&right==null) + return true; + if(left==null||right==null) + return false; + return left.val==right.val&&check(left.left,right.right)&&check(left.right,right.left); + } + + +} diff --git a/src/tree/TreeNode.java b/src/tree/TreeNode.java new file mode 100644 index 0000000..cb0cc5c --- /dev/null +++ b/src/tree/TreeNode.java @@ -0,0 +1,12 @@ +package tree; + +public class TreeNode { + int val; + TreeNode left; + TreeNode right; + + TreeNode(int x) { + val = x; + } + +}