forked from diliuzuzhanghao/coding2017
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request diliuzuzhanghao#7 from DonaldY/master
第10周作业拉取
- Loading branch information
Showing
178 changed files
with
7,497 additions
and
2,184 deletions.
There are no files selected for viewing
79 changes: 39 additions & 40 deletions
79
group24/1148285693/.gitignore → group24/1148285693/learning2017/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,39 @@ | ||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files | ||
*.war | ||
*.ear | ||
*.bk | ||
.gradle | ||
target | ||
*.class | ||
*.real | ||
|
||
# virtual machine crash logs | ||
# see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
# Eclipse Files # | ||
.project | ||
.classpath | ||
.settings | ||
|
||
# Idea | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea | ||
|
||
# log | ||
*_IS_UNDEFINED | ||
logs | ||
*.log | ||
|
||
# other | ||
*.bak | ||
.directory | ||
.DS_Store | ||
|
||
|
||
Test.java | ||
example | ||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files | ||
*.war | ||
*.ear | ||
*.bk | ||
.gradle | ||
target | ||
*.class | ||
*.real | ||
|
||
# virtual machine crash logs | ||
# see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
# Eclipse Files # | ||
.project | ||
.classpath | ||
.settings | ||
|
||
# Idea | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea | ||
|
||
# log | ||
*_IS_UNDEFINED | ||
logs | ||
*.log | ||
|
||
# other | ||
*.bak | ||
.directory | ||
.DS_Store | ||
|
||
|
||
Test.java |
54 changes: 54 additions & 0 deletions
54
group24/1148285693/learning2017/learning-basic/src/main/java/me/lzb/basic/FileList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package me.lzb.basic; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* 给定一个目录,递归的列出下面所有的子目录和文件 | ||
* | ||
* @author LZB | ||
*/ | ||
public class FileList { | ||
|
||
public void list(File f) { | ||
System.out.println(f.getPath()); | ||
|
||
list(f, 0); | ||
} | ||
|
||
|
||
private void list(File file, int level) { | ||
if (file.isDirectory()) { | ||
print(file, level); | ||
} | ||
level++; | ||
File[] files = file.listFiles(); | ||
for (int i = 0; i < files.length; i++) { | ||
if (files[i].isDirectory()) { | ||
list(files[i], level); | ||
} else { | ||
print(files[i], level); | ||
} | ||
} | ||
} | ||
|
||
private void print(File f, int level) { | ||
System.out.println(getFileFormat(level) + f.getName()); | ||
|
||
} | ||
|
||
|
||
private String getFileFormat(int level) { | ||
StringBuffer sb = new StringBuffer(); | ||
if (level > 1) { | ||
sb.append("|"); | ||
} | ||
|
||
for (int i = 0; i < level - 1; i++) { | ||
sb.append(" "); | ||
} | ||
if (level > 0) { | ||
sb.append("|--"); | ||
} | ||
return sb.toString(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...src/main/java/me/lzb/basic/ArrayList.java → ...ain/java/me/lzb/basic/list/ArrayList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package me.lzb.basic; | ||
package me.lzb.basic.list; | ||
|
||
/** | ||
* 简易ArrayList | ||
|
2 changes: 1 addition & 1 deletion
2
...src/main/java/me/lzb/basic/ArrayUtil.java → ...ain/java/me/lzb/basic/list/ArrayUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package me.lzb.basic; | ||
package me.lzb.basic.list; | ||
|
||
public class ArrayUtil { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
.../src/main/java/me/lzb/basic/Iterator.java → ...main/java/me/lzb/basic/list/Iterator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package me.lzb.basic; | ||
package me.lzb.basic.list; | ||
|
||
/** | ||
* Created by LZB on 2017/3/11. | ||
|
2 changes: 1 addition & 1 deletion
2
...rc/main/java/me/lzb/basic/LinkedList.java → ...in/java/me/lzb/basic/list/LinkedList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package me.lzb.basic; | ||
package me.lzb.basic.list; | ||
|
||
|
||
/** | ||
|
2 changes: 1 addition & 1 deletion
2
...asic/src/main/java/me/lzb/basic/List.java → ...src/main/java/me/lzb/basic/list/List.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package me.lzb.basic; | ||
package me.lzb.basic.list; | ||
|
||
/** | ||
* list接口 | ||
|
2 changes: 1 addition & 1 deletion
2
group24/1148285693/learning2017/learning-basic/src/main/java/me/lzb/basic/queue/Queue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package me.lzb.basic.queue; | ||
|
||
import me.lzb.basic.LinkedList; | ||
import me.lzb.basic.list.LinkedList; | ||
|
||
/** | ||
* 先进先出 | ||
|
2 changes: 1 addition & 1 deletion
2
group24/1148285693/learning2017/learning-basic/src/main/java/me/lzb/basic/stack/Stack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package me.lzb.basic.stack; | ||
|
||
import me.lzb.basic.ArrayList; | ||
import me.lzb.basic.list.ArrayList; | ||
|
||
/** | ||
* 先进后出 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...148285693/learning2017/learning-basic/src/main/java/me/lzb/basic/tree/BinaryTreeNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package me.lzb.basic.tree; | ||
|
||
/** | ||
* @author LZB | ||
*/ | ||
public class BinaryTreeNode<T> { | ||
private T data; | ||
private BinaryTreeNode<T> left; | ||
private BinaryTreeNode<T> right; | ||
|
||
public BinaryTreeNode(T data) { | ||
this.data = data; | ||
} | ||
|
||
public T getData() { | ||
return data; | ||
} | ||
|
||
public void setData(T data) { | ||
this.data = data; | ||
} | ||
|
||
public BinaryTreeNode<T> getLeft() { | ||
return left; | ||
} | ||
|
||
public void setLeft(BinaryTreeNode<T> left) { | ||
this.left = left; | ||
} | ||
|
||
public BinaryTreeNode<T> getRight() { | ||
return right; | ||
} | ||
|
||
public void setRight(BinaryTreeNode<T> right) { | ||
this.right = right; | ||
} | ||
|
||
public BinaryTreeNode<T> insert(Object o) { | ||
return null; | ||
} | ||
|
||
} |
Oops, something went wrong.