Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam ...
分类:
其他好文 时间:
2017-10-06 18:04:39
阅读次数:
145
One day Vasya was going home when he saw a box lying on the road. The box can be represented as a rectangular parallelepiped. Vasya needed no time to ...
分类:
其他好文 时间:
2017-10-06 16:23:45
阅读次数:
154
link Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the ...
分类:
其他好文 时间:
2017-10-05 23:10:06
阅读次数:
238
题目链接:http://poj.org/problem?id=3254 Time Limit: 2000MS Memory Limit: 65536K Description Farmer John has purchased a lush new rectangular pasture compo ...
分类:
其他好文 时间:
2017-10-03 12:43:18
阅读次数:
155
原题链接在这里:https://leetcode.com/problems/largest-divisible-subset/description/ 题目: Given a set of distinct positive integers, find the largest subset suc ...
分类:
其他好文 时间:
2017-10-02 12:40:42
阅读次数:
127
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. For example, given the following ma ...
分类:
其他好文 时间:
2017-10-01 21:09:40
阅读次数:
107
class Solution { public int largestRectangleArea(int[] heights) { Stack stack=new Stack(); int maxArea=0; for(int i=0;i<=heights.length;i++) { int h=i... ...
分类:
其他好文 时间:
2017-09-28 09:50:47
阅读次数:
155
You are given n numbers. Store them in a list and find the second largest number. ...
分类:
编程语言 时间:
2017-09-26 13:09:31
阅读次数:
120
https://leetcode.com/problems/largest-palindrome-product/description/ ...
分类:
其他好文 时间:
2017-09-25 19:53:18
阅读次数:
123
堆排序 堆节点的访问 通常堆是通过一维数组来实现的。在数组起始位置为0的情形中: 父节点i的左子节点在位置(2*i+1); 父节点i的右子节点在位置(2*i+2); 子节点i的父节点在位置floor((i-1)/2); 堆的操作 在堆的数据结构中,堆中的最大值总是位于根节点(在优先队列中使用堆的话堆 ...
分类:
编程语言 时间:
2017-09-25 11:30:15
阅读次数:
237