08 2017 档案
摘要:题目描述 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farth
阅读全文
摘要:题目描述 Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 思路:注意垂直和重叠的点 代码 时间341ms 空间19988k /** * Defini
阅读全文
摘要:题目描述 Sort a linked list in O(n log n) time using constant space complexity. 思路:时间复杂度为O(nlogn),空间复杂度为常数,用归并排序 在下的代码 时间1162ms 空间27696k /** * Definition
阅读全文
摘要:题目描述 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime c
阅读全文
摘要:题目描述 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are+,-,*,/. Each operand may be an integer or another
阅读全文
摘要:题目描述 Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the neare
阅读全文

浙公网安备 33010602011771号