摘要: This was asked in LinkedIn Interview Given a list of child->parent relationships, build a binary tree out of it. All the element Ids inside the tree are unique. Example: Given the following relatio... 阅读全文
posted @ 2017-12-01 23:47 apanda009 阅读(391) 评论(0) 推荐(0)
摘要: public class TextFile implements Iterable{ private BufferedReader br; public TextFile(String fileName) throws FileNotFoundException { br = new BufferedReader(new FileR... 阅读全文
posted @ 2017-12-01 22:07 apanda009 阅读(150) 评论(0) 推荐(0)
摘要: public class MyList { private static final int DEFAULT_CAPACITY = 10; private E[] elements; private int size = 0; public MyList() { elements = new E[DEFAULT_CAPACITY]; ... 阅读全文
posted @ 2017-12-01 12:49 apanda009 阅读(145) 评论(0) 推荐(0)
摘要: public static String intToRoman(int num) { String M[] = {"", "M", "MM", "MMM"}; String C[] = {"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"}; Strin 阅读全文
posted @ 2017-12-01 11:00 apanda009 阅读(93) 评论(0) 推荐(0)
摘要: input check, 正数? In every recursion, we at most try k groups, which means the search tree has k branches at most. And the depth of the search tree is 阅读全文
posted @ 2017-12-01 09:29 apanda009 阅读(297) 评论(0) 推荐(0)