二分
文章平均质量分 72
chuandalishuo
这个作者很懒,什么都没留下…
展开
-
23.Merge k Sorted Lists
题目:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Java /** * Definition for singly-linked list. * public class ListNode { * int val;原创 2016-05-17 00:26:08 · 297 阅读 · 0 评论 -
29. Divide Two Integers
题目: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. Java public class Solution { public int divide(int dividend, int divisor) {原创 2016-06-16 00:27:15 · 191 阅读 · 0 评论 -
162. Find Peak Element
A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its index. The array may contain multiple peaks, in原创 2016-09-29 00:29:59 · 135 阅读 · 0 评论 -
287. Find the Duplicate Number
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number,原创 2016-11-01 01:18:37 · 143 阅读 · 0 评论 -
314. Binary Tree Vertical Order Traversal
题目: Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the same row and column, the order should be fr原创 2016-12-04 08:59:10 · 202 阅读 · 0 评论 -
257. Binary Tree Paths
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: ["1->2->5", "1->3"] /**原创 2016-12-05 10:48:47 · 168 阅读 · 0 评论 -
274,275. H-Index I, II
Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According to the definition of h-index on Wikipedia: "A原创 2016-12-08 13:09:40 · 216 阅读 · 0 评论