Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4383c19
修改 POM 文件
honeymoose Dec 25, 2018
824355a
尝试将 README 名字大写
honeymoose Dec 25, 2018
efcfd98
README 文件名大写
honeymoose Dec 25, 2018
58b84c1
将包的名字进行重命名
honeymoose Dec 25, 2018
6b3f0af
Kayak 面试题中的 Unit 测试
honeymoose Dec 25, 2018
8a65195
Kayak 代码面试题中的有关按照坐标移动的问题
honeymoose Dec 25, 2018
91a4b79
有关问题的 详细解释和说明,请参考
honeymoose Dec 25, 2018
145596a
更新测试结果,修改 https://www.cwiki.us/display/ITCLASSIFICATION/Robot+Movement
honeymoose Dec 25, 2018
a35c713
Kayak 添加数组排列算法
honeymoose Dec 25, 2018
aa0b09e
不使用循环的方式输出循环的值,具体问题,请参考:https://www.cwiki.us/display/ITCLASSIFICATION…
honeymoose Dec 26, 2018
7929632
不使用循环的输出测试程序
honeymoose Dec 26, 2018
96ea15e
修改包的名字
honeymoose Dec 26, 2018
853a073
修改包的名字
honeymoose Dec 26, 2018
c8fada5
修改包的名字进行修改
honeymoose Dec 26, 2018
d12dd97
添加新的测试 JUnit 类
honeymoose Dec 26, 2018
edd772d
展平数组测试
honeymoose Dec 27, 2018
197a358
添加新的测试数据
honeymoose Dec 27, 2018
1fab3fa
提交一个 Java 8 的方法和一个递归的方法
honeymoose Dec 27, 2018
eeb8638
格式化 import
honeymoose Dec 27, 2018
53563f0
添加 Wayfair 测试类
honeymoose Dec 29, 2018
dd15b81
找到合适城堡的地方
honeymoose Dec 29, 2018
c3d2a81
计算二项式系数和使用 Apache Math 包
honeymoose Dec 30, 2018
ee63989
CODEBANK-2 添加代码到 Code Bank
honeymoose Jan 3, 2019
689ec45
Amazon 面试代码挑战题目
honeymoose Jan 3, 2019
0497808
MassMutual JSON 处理测试方法
honeymoose Jan 10, 2019
f5a896f
下一个斐波拉契数
honeymoose Feb 8, 2019
d34c492
LambdaEvens
honeymoose Jul 24, 2020
b4d068c
Find the Lambda evens for giving string
honeymoose Jul 24, 2020
c050537
Adjust the function
honeymoose Jul 24, 2020
4f12236
Get count for coins
honeymoose Jul 24, 2020
7f1d39f
Merge remote-tracking branch 'codebank-algorithm/master' into code_bank
honeymoose Apr 23, 2021
32c304a
set version for toolkits
honeymoose Apr 23, 2021
5510d7f
OSSEZ-88 Push to different version of POM
honeymoose Apr 23, 2021
75dad45
Merge remote-tracking branch 'origin/master' into code_bank
honeymoose Apr 23, 2021
708607f
Merge remote-tracking branch 'origin/master' into code_bank
yhu-insight Apr 23, 2021
ef1da1a
Merge branch 'code_bank' of https://github.com/cwiki-us-docs/java-tut…
honeymoose Apr 23, 2021
61104e9
OSSEZ-88 0.0.1-SNAPSHOT 补充提交到仓库中
honeymoose Apr 23, 2021
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
8 changes: 8 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 62 additions & 15 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.ossez</groupId>
<artifactId>parent-modules</artifactId>
<version>0.0.1</version>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>CWIKIUS-OSSEZ Java Parent Modules</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ossez.lang.tutorial;
package com.ossez.codebank.algorithm;

import java.util.Properties;

Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/ossez/codebank/algorithm/models/ListNode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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;
}
}
16 changes: 16 additions & 0 deletions src/main/java/com/ossez/codebank/algorithm/models/TreeNode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ossez.lang.tutorial.objplusclass;
package com.ossez.codebank.algorithm.objplusclass;

/**
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ossez.lang.tutorial.overview;
package com.ossez.codebank.algorithm.overview;

/**
* Java Tutorial
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ossez.lang.tutorial.overview;
package com.ossez.codebank.algorithm.overview;

/**
* Java Tutorial
Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
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;

}
}
package com.ossez.codebank.algorithml.utils;
import java.util.ArrayList;
import com.ossez.codebank.algorithm.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;
}
}
86 changes: 86 additions & 0 deletions src/main/java/com/ossez/codebank/interview/KayakCountUpDown.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package com.ossez.codebank.interview;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
*
* https://www.cwiki.us/display/ITCLASSIFICATION/Count+Up+Down
*
* @author YuCheng
*
*/
public class KayakCountUpDown {
private final static Logger logger = LoggerFactory.getLogger(KayakCountUpDown.class);

static int minNumber = 0;
static int maxNumber = 0;
int tmpN = 0;
List<Integer> retList = new ArrayList<Integer>();

/**
*
* @param start
* @param end
* @return
*/
public List<Integer> countUp(int start, int end) {
logger.debug("BEGIN");
maxNumber = end;
tmpN = start;
moveUp(0);
retList.add(end);
return retList;

}

/**
*
* @param start
* @param end
* @return
*/
public List<Integer> countUpDown(int start, int end) {
logger.debug("BEGIN");
minNumber = start;
maxNumber = end;
tmpN = start;

moveUp(0);
retList.add(end);

moveDown(1);
return retList;

}

/**
*
* @param n
*/
private void moveUp(int n) {
retList.add(tmpN);
tmpN++;
if (tmpN != maxNumber) {
moveUp(tmpN + 1);
}

}

/**
*
* @param n
*/
private void moveDown(int n) {
tmpN = (maxNumber - n);
retList.add(tmpN);

if (tmpN != minNumber) {
moveDown(n + 1);
}
}

}
Loading