06 2016 档案

283. Move Zeroes
摘要:1. 问题描述 Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For exam 阅读全文

posted @ 2016-06-29 22:04 whl-hl 阅读(160) 评论(0) 推荐(0)

237. Delete Node in a Linked List
摘要:1. 问题描述 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 -> 阅读全文

posted @ 2016-06-27 22:45 whl-hl 阅读(129) 评论(0) 推荐(0)

100. Same Tree
摘要:1. 问题描述 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 ide 阅读全文

posted @ 2016-06-26 22:13 whl-hl 阅读(162) 评论(0) 推荐(0)

226. Invert Binary Tree
摘要:1. 问题描述 Invert a binary tree. to Tag: Tree /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right 阅读全文

posted @ 2016-06-23 21:30 whl-hl 阅读(159) 评论(0) 推荐(0)

169. Majority Element
摘要:1. 问题描述 Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume t 阅读全文

posted @ 2016-06-23 21:29 whl-hl 阅读(141) 评论(0) 推荐(0)

349. Intersection of Two Arrays
摘要:1. 问题描述 Given two arrays, write a function to compute their intersection. Example: Note: Each element in the result must be unique.The result can be i 阅读全文

posted @ 2016-06-18 19:27 whl-hl 阅读(166) 评论(0) 推荐(0)

104. Maximum Depth of Binary Tree
摘要:1. 问题描述 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 far 阅读全文

posted @ 2016-06-18 19:06 whl-hl 阅读(132) 评论(0) 推荐(0)

258. Add Digits
摘要:1. 问题描述 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example: Given num = 38, the process i 阅读全文

posted @ 2016-06-18 18:49 whl-hl 阅读(123) 评论(0) 推荐(0)

292. Nim Game
摘要:1. 问题描述 You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 t 阅读全文

posted @ 2016-06-18 17:53 whl-hl 阅读(133) 评论(0) 推荐(0)

21. Merge Two Sorted Lists
摘要:1. 问题描述 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.T 阅读全文

posted @ 2016-06-17 21:44 whl-hl 阅读(137) 评论(0) 推荐(0)

43. Multiply Strings
摘要:1. 问题描述 Given two numbers represented as strings, return multiplication of the numbers as a string.Note:The numbers can be arbitrarily large and are n 阅读全文

posted @ 2016-06-16 22:35 whl-hl 阅读(99) 评论(0) 推荐(0)

66. Plus One
摘要:1. 问题描述 Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant di 阅读全文

posted @ 2016-06-15 22:22 whl-hl 阅读(214) 评论(0) 推荐(0)

67. Add Binary
摘要:1. 问题描述 Given two binary strings, return their sum (also a binary string). Tags: Math String 2. 解答思路 3. 代码 4. 反思 阅读全文

posted @ 2016-06-14 21:56 whl-hl 阅读(132) 评论(0) 推荐(0)

2. Add Two Numbers
摘要:1. 问题描述 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a 阅读全文

posted @ 2016-06-13 22:04 whl-hl 阅读(148) 评论(0) 推荐(0)

8. String to Integer (atoi)
摘要:1. 问题描述 Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not se 阅读全文

posted @ 2016-06-13 20:18 whl-hl 阅读(146) 评论(0) 推荐(0)

18. 4Sum
摘要:1. 问题描述 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the ar 阅读全文

posted @ 2016-06-12 21:35 whl-hl 阅读(129) 评论(0) 推荐(0)

15. 3Sum
摘要:1. 问题描述 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the 阅读全文

posted @ 2016-06-12 21:29 whl-hl 阅读(124) 评论(0) 推荐(0)

1. Two Sum
摘要:1. 问题描述 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 阅读全文

posted @ 2016-06-11 11:43 whl-hl 阅读(142) 评论(0) 推荐(0)

227. Basic Calculator
摘要:1. 问题描述 Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / ope 阅读全文

posted @ 2016-06-10 10:49 whl-hl 阅读(207) 评论(0) 推荐(0)

7. Reverse Integer
摘要:1. 问题描述 Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? 阅读全文

posted @ 2016-06-10 10:16 whl-hl 阅读(144) 评论(0) 推荐(0)

导航