修改包的名字

This commit is contained in:
YuCheng Hu 2018-12-26 17:38:00 -05:00
parent 96ea15ef65
commit 853a073b65
7 changed files with 36 additions and 91 deletions

View File

@ -1,4 +1,4 @@
package com.ossez.lang.tutorial;
package com.ossez.codebank.algorithm;
import java.util.Properties;

View File

@ -1,16 +1,16 @@
package com.ossez.lang.tutorial.models;
/**
*
* @author YuCheng
*
*/
public class ListNode {
public int val;
public ListNode next;
public ListNode(int x) {
val = x;
next = null;
}
}
package com.ossez.codebank.algorithm.models;
/**
*
* @author YuCheng
*
*/
public class ListNode {
public int val;
public ListNode next;
public ListNode(int x) {
val = x;
next = null;
}
}

View File

@ -1,16 +1,16 @@
package com.ossez.lang.tutorial.models;
/**
*
* @author YuCheng
*
*/
public class TreeNode {
public int val;
public TreeNode left, right;
public TreeNode(int val) {
this.val = val;
this.left = this.right = null;
}
}
package com.ossez.codebank.algorithm.models;
/**
*
* @author YuCheng
*
*/
public class TreeNode {
public int val;
public TreeNode left, right;
public TreeNode(int val) {
this.val = val;
this.left = this.right = null;
}
}

View File

@ -1,4 +1,4 @@
package com.ossez.lang.tutorial.objplusclass;
package com.ossez.codebank.algorithm.objplusclass;
/**
*

View File

@ -1,4 +1,4 @@
package com.ossez.lang.tutorial.overview;
package com.ossez.codebank.algorithm.overview;
/**
* Java Tutorial

View File

@ -1,4 +1,4 @@
package com.ossez.lang.tutorial.overview;
package com.ossez.codebank.algorithm.overview;
/**
* Java Tutorial

View File

@ -1,55 +0,0 @@
package com.ossez.lang.tutorial.utils;
import java.util.ArrayList;
import com.ossez.lang.tutorial.models.TreeNode;
/**
*
* @author YuCheng
*
*/
public class TreeUtils {
public static TreeNode initTree(String data) {
// NULL CHECK
if (data.equals("{}")) {
return null;
}
ArrayList<TreeNode> treeList = new ArrayList<TreeNode>();
data = data.replace("{", "");
data = data.replace("}", "");
String[] vals = data.split(",");
// INSERT ROOT
TreeNode root = new TreeNode(Integer.parseInt(vals[0]));
treeList.add(root);
int index = 0;
boolean isLeftChild = true;
for (int i = 1; i < vals.length; i++) {
if (!vals[i].equals("#")) {
TreeNode node = new TreeNode(Integer.parseInt(vals[i]));
if (isLeftChild) {
treeList.get(index).left = node;
} else {
treeList.get(index).right = node;
}
treeList.add(node);
}
// LEVEL
if (!isLeftChild) {
index++;
}
// MOVE TO RIGHT OR NEXT LEVEL
isLeftChild = !isLeftChild;
}
return root;
}
}