摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文
posted @ 2016-04-21 15:03 Miller1991 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list. click to show more hints. Hint: A linked list can be reversed either iteratively or recursively. Could you implement bot 阅读全文
posted @ 2016-04-21 14:16 Miller1991 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a 阅读全文
posted @ 2016-04-21 11:48 Miller1991 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2016-04-18 13:53 Miller1991 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes? 阅读全文
posted @ 2016-04-15 20:31 Miller1991 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F 阅读全文
posted @ 2016-04-15 19:54 Miller1991 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur 阅读全文
posted @ 2016-04-15 19:39 Miller1991 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
posted @ 2016-04-15 19:13 Miller1991 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 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 exa 阅读全文
posted @ 2016-04-15 17:38 Miller1991 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit 阅读全文
posted @ 2016-04-15 17:23 Miller1991 阅读(129) 评论(0) 推荐(0) 编辑