- 博客(8)
- 收藏
- 关注
原创 Maze problem 的OO Design - 写给煜小堆
Question: How do you design a Maze and what kind of data structures you use for Maze. In addition, write a method to print the shorted path from start to end point.Example:#############
2016-02-28 12:35:08
514
原创 Two Sum Closest to K
An Array of integers is given, both +ve and -ve. You need to find the two elements such that their sum is closest to target.public static int[] findTwoSumClosest(int[] num, int target) { if(nu
2015-01-31 05:47:10
584
原创 Design a valet parking system.
Design a valet parking system. Requirements of the valet parking system should be: 1. Customer are given a ticket that they can use to redeem to get their vehicle back 2. Parking spots come in thr
2015-01-30 08:11:59
605
原创 OOD - Arithmetic Expression Tree
package OO_Problems;public class ArithmeticExpressionTree { public interface AENode{ public double evaluate() throws EvaluationException; } public class AEValueNode implements AENode{ priva
2015-01-26 16:01:19
597
原创 这两道题的区别 LeetCode Permutations 和 LeetCode Combinations
刷第一遍的时候觉得这两道题巨尼玛像,但是为啥一个用了isVisited boolean数组,一个就是正常iterate。刷第二遍的时候终于醒悟了:1,Permutation - Order Matters!!!!!要回溯,[1,4] 出现了之后,还想要[4,1], 所以要判断是否有被visithttps://oj.leetcode.com/problems/permutat
2015-01-20 06:49:15
1015
原创 Remove Node in Binary Search Tree
This is one of the pretty interesting technical interview questions I see, it is rather fundamental, you probably have seen similar from your text book. But you know what, in the real interview proces
2015-01-20 05:49:40
1273
原创 How to compare 2 arrays in java
// we need to import java.util.Arrays to use Arrays.equals().import java.util.Arrays;class Test{ public static void main (String[] args) { int arr1[] = {1, 2, 3}; int arr2[
2015-01-02 14:04:42
609
原创 Lowest Common Ancestor (LCA) of two nodes in graph
In graph theory and computer science, the lowest common ancestor (LCA) of two nodes v and w in a tree or directed acyclic graph (DAG) is the lowest (i.e. deepest) node that has both v and w
2014-12-30 14:01:28
772
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人