摘要:
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
摘要:
题目: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sort 阅读全文
摘要:
题目: Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in th 阅读全文
摘要:
题目: Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a targe 阅读全文
摘要:
题目 :Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. 正确代码:package leetcode;public class newSetMatrixZeroe 阅读全文
摘要:
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, 阅读全文
摘要:
题目:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix: Y 阅读全文