
01 Matrix
Leave a commentJune 20, 2017 by oneOokay
Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance …
Continue reading 
三个点的位置.Graham scan.Convex Hull
Leave a commentJune 18, 2017 by oneOokay
解决的是几何问题… 两条直线是否相交 二维数组标示x,y的点的集合, Find simple closed path. 就是点集外檐的一个轮廓.(connect the dots without crossing) 同样点的集合,求形成一个凸包的边缘点的集合. Orientation of 3 ordered points http://www.geeksforgeeks.org/orientation3orderedpoints/ 给3个点,判断这三个点的相对位置. …
Continue reading 
Boundary of Binary Tree
Leave a commentMay 26, 2017 by oneOokay
Given a binary tree, return the values of its boundary in anticlockwise direction starting from root. Boundary includes left boundary, …
Continue reading 
Binary Tree Longest Consecutive Sequence II
Leave a commentMay 26, 2017 by oneOokay
Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree. Especially, this path …
Continue reading 
Shortest Unsorted Continuous Subarray
Leave a commentMay 25, 2017 by oneOokay
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending …
Continue reading 
Edit Distance
Leave a commentMay 25, 2017 by oneOokay
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation …
Continue reading 
二维矩阵int[][] tips
Leave a commentMay 24, 2017 by oneOokay
一个二维矩阵int[][] : m X n 在不另建class的情况下: Queue<int[]> queue = new LinkedList<int[]>(); queue里面直接放一个Int[2]代表一个点 queue.offer(new int[]{x, y}); queue.offer(start); //if start 是一个int[2] boolean[][] …
Continue reading