java
抱着嫦娥烤月兔
面朝大海,春暖花开
展开
-
Leetcode 82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given 1->1->1->2原创 2016-10-21 11:39:21 · 309 阅读 · 0 评论 -
Leetcode 94. Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary tree [1,null,2,3], 1 \ 2 / 3 return [1,3,2]. 题意:中序遍历二叉树 题解:用递归的方法很容易求解,但是对于大原创 2016-11-04 17:04:34 · 383 阅读 · 0 评论 -
Leetcode 263-264 ugly number
Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it in原创 2016-10-25 21:58:55 · 294 阅读 · 0 评论 -
Leetcode 338. Counting Bits
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example: For num = 5 you sh原创 2016-10-27 21:58:11 · 336 阅读 · 0 评论 -
Leetcode 237. Delete Node in a Linked List
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, t原创 2016-10-21 10:57:39 · 290 阅读 · 0 评论