Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Merge latest updates#1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
singlemancombat wants to merge66 commits intorpj911:master
base:master
Choose a base branch
Loading
fromsinglemancombat:master
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
66 commits
Select commitHold shift + click to select a range
bd11ddf
KthSort
yuzhangcmuSep 23, 2014
841e167
add the demos
yuzhangcmuSep 23, 2014
dabfdb7
min cut
yuzhangcmuSep 25, 2014
762dcad
Create README.md
yuzhangcmuSep 25, 2014
ce3384e
Update README.md
yuzhangcmuSep 25, 2014
078baa7
modify the directors
yuzhangcmuSep 26, 2014
ab453fc
move the folder.
yuzhangcmuSep 26, 2014
af5edeb
modify the tree Demo
yuzhangcmuSep 26, 2014
52407ba
The LCA problem.
yuzhangcmuSep 26, 2014
7c9819f
add some comments.
yuzhangcmuSep 26, 2014
bb3eb2b
Arrange the code.
yuzhangcmuSep 27, 2014
fa314c2
merge Sort
yuzhangcmuSep 28, 2014
37c4105
merge
yuzhangcmuOct 2, 2014
b0e4e32
Five Chessman
yuzhangcmuOct 2, 2014
441dba7
FiveChessman
yuzhangcmuOct 2, 2014
2eec824
notes
yuzhangcmuOct 2, 2014
1551e7f
the largest Common subtree
yuzhangcmuOct 2, 2014
61e79b2
the largest common
yuzhangcmuOct 2, 2014
ff798ae
largestCommon
yuzhangcmuOct 2, 2014
718698d
TestPermutation
yuzhangcmuOct 5, 2014
7d60ff4
isCompleteBinaryTree
yuzhangcmuOct 5, 2014
c73a8a7
NextPermutation
yuzhangcmuOct 5, 2014
8c9f0e8
permutation sequence
yuzhangcmuOct 5, 2014
b8c8f5f
Fibonacci
yuzhangcmuOct 5, 2014
92f4168
add new file
Oct 7, 2014
f928b91
add code.
Oct 7, 2014
b6817a6
Recover Binary Search Tree
yuzhangcmuOct 8, 2014
a758230
isValidBST
yuzhangcmuOct 8, 2014
c04d009
in order
yuzhangcmuOct 8, 2014
3292319
tree
yuzhangcmuOct 8, 2014
8f28a48
tree
yuzhangcmuOct 8, 2014
2d0cf85
minDepth
yuzhangcmuOct 8, 2014
dc15508
min
yuzhangcmuOct 8, 2014
de48d99
facebook
yuzhangcmuOct 8, 2014
72f914d
Unique BSTs
yuzhangcmuOct 9, 2014
d92fcd1
tree2
yuzhangcmuOct 9, 2014
632666f
merge Sort
yuzhangcmuOct 9, 2014
d1c27bd
merge
yuzhangcmuOct 9, 2014
ec77e43
remove duplicate
yuzhangcmuOct 9, 2014
127db30
remove duplicates2
yuzhangcmuOct 9, 2014
63dd8d0
array
yuzhangcmuOct 9, 2014
23f07e3
search
yuzhangcmuOct 9, 2014
bd02708
maxSubArray
yuzhangcmuOct 9, 2014
88a4d50
the merge
yuzhangcmuOct 9, 2014
0ccff33
strstr
yuzhangcmuOct 10, 2014
096b743
list
yuzhangcmuOct 10, 2014
d955d59
divide
yuzhangcmuOct 10, 2014
218d63f
pow
yuzhangcmuOct 10, 2014
4f99b2d
pow
yuzhangcmuOct 10, 2014
7564463
list
yuzhangcmuOct 10, 2014
1ddacc5
sort
yuzhangcmuOct 10, 2014
d5573fc
reorder list
yuzhangcmuOct 10, 2014
c144ac6
random
yuzhangcmuOct 10, 2014
2a37fec
reverse2
yuzhangcmuOct 10, 2014
150f920
tree
yuzhangcmuOct 10, 2014
82143ad
name
yuzhangcmuOct 10, 2014
f08140a
lett
yuzhangcmuOct 11, 2014
42796c9
list
yuzhangcmuOct 11, 2014
d6d1308
list
yuzhangcmuOct 11, 2014
0060c07
rotate
yuzhangcmuOct 11, 2014
72e5ddf
list
yuzhangcmuOct 11, 2014
cfdbfe8
remove
yuzhangcmuOct 11, 2014
732d38a
list
yuzhangcmuOct 11, 2014
53f429f
tree
yuzhangcmuOct 11, 2014
1693ac2
candy
yuzhangcmuOct 11, 2014
7a80b46
combine
yuzhangcmuOct 11, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
remove duplicate
  • Loading branch information
@yuzhangcmu
yuzhangcmu committedOct 9, 2014
commitec77e43960719d2659c7236799df1b44385389ba
9 changes: 4 additions & 5 deletionsarray/MaxProduct.java
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,10 +3,7 @@
public class MaxProduct {
public static int maxProduct(int[] A) {
int max = 0;

int left = 0;
int right = 0;


int len = A.length;

int product = 1;
Expand All@@ -15,11 +12,13 @@ public static int maxProduct(int[] A) {
if (A[i] <= 0) {
max = Math.max(max, product);
product = 1;
continue;
}

product *= A[i];
}

return0;
returnmax;
}

/*
Expand Down
20 changes: 20 additions & 0 deletionsarray/RemoveDuplicates.java
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
package Algorithms.array;

public class RemoveDuplicates {
public int removeDuplicates(int[] A) {
if (A == null || A.length == 0) {
return 0;
}

// A里至少有1个元素
int len = 1;

for (int i = 1; i < A.length; i++) {
if (A[i] != A[i - 1]) {
A[len++] = A[i];
}
}

return len;
}
}

[8]ページ先頭

©2009-2025 Movatter.jp