• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
02 2016 档案
M面经prepare: Shuffle a deck

摘要:设计一个shuffle card 用了java. Random Class 1 package Random; 2 import java.util.*; 3 4 public class Solution { 5 static int cardNum = 10; 6 public int[] sh 阅读全文
posted @ 2016-02-17 04:50 neverlandly 阅读(613) 评论(0) 推荐(0)
M面经Prepare: Find integer Average of 2 integers.

摘要:The definition of integer average is the highest smaller integer if average is floating point number. Also the condition if that they can not use any 阅读全文
posted @ 2016-02-16 11:56 neverlandly 阅读(401) 评论(0) 推荐(0)
M面经Prepare: Positive-Negative partitioning preserving order

摘要:Given an array which has n integers,it has both positive and negative integers.Now you need sort this array in a special way.After that,the negative i 阅读全文
posted @ 2016-02-16 07:40 neverlandly 阅读(386) 评论(0) 推荐(0)
M面经Prepare: Delete Words Starting With One Character

摘要:给定一个char array, 这个array是一个句子,然后给定一个字母,把这个array里面带有这个字母开头的单次删掉,操作是要求in place. 检测 array[i]==' ' && i<array.length-1 && array[i+1]==target,这种情况,设置j从i+1开始 阅读全文
posted @ 2016-02-16 04:15 neverlandly 阅读(326) 评论(0) 推荐(0)
Lintcode: Subtree

摘要:You have two every large binary trees: T1, with millions of nodes, and T2, with hundreds of nodes. Create an algorithm to decide if T2 is a subtree of 阅读全文
posted @ 2016-02-08 23:45 neverlandly 阅读(425) 评论(0) 推荐(0)
Leetcode: Reconstruct Itinerary

摘要:refer to Recursion https://leetcode.com/discuss/84702/share-my-solution and Iteration https://leetcode.com/discuss/84706/share-solution-java-greedy-st 阅读全文
posted @ 2016-02-08 12:29 neverlandly 阅读(4099) 评论(0) 推荐(0)
Groupon面经:Find paths in a binary tree summing to a target value

摘要:You are given a binary tree (not necessarily BST) in which each node contains a value. Design an algorithm to print all paths which sum up to that val 阅读全文
posted @ 2016-02-04 12:02 neverlandly 阅读(620) 评论(0) 推荐(0)
Groupon面经Prepare: Max Cycle Length

摘要:题目是遇到偶数/2,遇到奇数 *3 + 1的题目,然后找一个range内所有数字的max cycle length。对于一个数字,比如说44,按照题目的公式不停计算,过程是 44, 22, 11, 8, 9 ,1(瞎起的),从44到1的这个sequence的长度,叫做cycle length。然后题 阅读全文
posted @ 2016-02-04 05:21 neverlandly 阅读(600) 评论(0) 推荐(0)
Groupon面经Prepare: Sort given a range && Summary: Bucket Sort

摘要:首先是如何sort一个只有0和1的数组,要求inplace. follow up是告诉一个range,如何在O(N)时间内sort好 两个pointer可解 1 package Sorting; 2 import java.util.*; 3 4 public class InplaceSortin 阅读全文
posted @ 2016-02-04 01:27 neverlandly 阅读(374) 评论(0) 推荐(0)
Lintcode: Expression Evaluation (Basic Calculator III)

摘要:Given an expression string array, return the final result of this expression Have you met this question in a real interview? Yes Example For the expre 阅读全文
posted @ 2016-02-02 13:16 neverlandly 阅读(1202) 评论(0) 推荐(0)
Lintcode: Count of Smaller Number

摘要:Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) and an query list. For each query, give you 阅读全文
posted @ 2016-02-02 07:22 neverlandly 阅读(679) 评论(0) 推荐(0)
Lintcode: Interval Sum II

摘要:Given an integer array in the construct method, implement two methods query(start, end) and modify(index, value): For query(start, end), return the su 阅读全文
posted @ 2016-02-02 05:24 neverlandly 阅读(486) 评论(0) 推荐(0)
Lintcode: Interval Sum

摘要:Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. Each query has two integers [start, end]. For each 阅读全文
posted @ 2016-02-02 04:46 neverlandly 阅读(1003) 评论(0) 推荐(0)
Lintcode: Interval Minimum Number

摘要:Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. Each query has two integers [start, end]. For each 阅读全文
posted @ 2016-02-01 12:30 neverlandly 阅读(700) 评论(0) 推荐(0)
Lintcode: Segment Tree Query II

摘要:For an array, we can build a SegmentTree for it, each node stores an extra attribute count to denote the number of elements in the the array which val 阅读全文
posted @ 2016-02-01 11:46 neverlandly 阅读(599) 评论(0) 推荐(0)
Lintcode: Segment Tree Modify

摘要:For a Maximum Segment Tree, which each node has an extra value max to store the maximum value in this node's interval. Implement a modify function wit 阅读全文
posted @ 2016-02-01 08:05 neverlandly 阅读(311) 评论(0) 推荐(0)
Lintcode: Segment Tree Query

摘要:For an integer array (index from 0 to n-1, where n is the size of this array), in the corresponding SegmentTree, each node stores an extra attribute m 阅读全文
posted @ 2016-02-01 07:52 neverlandly 阅读(814) 评论(0) 推荐(0)
Leetcode: Verify Preorder Serialization of a Binary Tree

摘要:One way to serialize a binary tree is to use pre-oder traversal. When we encounter a non-null node, we record the node's value. If it is a null node, 阅读全文
posted @ 2016-02-01 07:31 neverlandly 阅读(1174) 评论(0) 推荐(0)
Lintcode: Segment Tree Build

摘要:The structure of Segment Tree is a binary tree which each node has two attributes start and end denote an segment / interval. start and end are both i 阅读全文
posted @ 2016-02-01 06:41 neverlandly 阅读(304) 评论(0) 推荐(0)
Lintcode: Matrix Zigzag Traversal

摘要:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in ZigZag-order. Have you met this question in a real intervie 阅读全文
posted @ 2016-02-01 05:24 neverlandly 阅读(654) 评论(0) 推荐(0)

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3