1. 01 Matrix

    Leave a comment

    June 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

  2. 三个点的位置.Graham scan.Convex Hull

    Leave a comment

    June 18, 2017 by oneOokay

    解决的是几何问题… 两条直线是否相交 二维数组标示x,y的点的集合, Find simple closed path. 就是点集外檐的一个轮廓.(connect the dots without crossing) 同样点的集合,求形成一个凸包的边缘点的集合. Orientation of 3 ordered points http://www.geeksforgeeks.org/orientation-3-ordered-points/ 给3个点,判断这三个点的相对位置. …
    Continue reading

  3. Boundary of Binary Tree

    Leave a comment

    May 26, 2017 by oneOokay

    Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, …
    Continue reading

  4. Binary Tree Longest Consecutive Sequence II

    Leave a comment

    May 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

  5. Shortest Unsorted Continuous Subarray

    Leave a comment

    May 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

  6. Edit Distance

    Leave a comment

    May 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

  7. 二维矩阵int[][] tips

    Leave a comment

    May 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