08 2016 档案

345. Reverse Vowels of a String
摘要:1. 问题描述 Write a function that takes a string as input and reverse only the vowels of a string. Note:The vowels does not include the letter "y".Tags: T 阅读全文

posted @ 2016-08-29 23:02 whl-hl 阅读(124) 评论(0) 推荐(0)

58. Length of Last Word
摘要:1. 问题描述 Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the la 阅读全文

posted @ 2016-08-26 23:37 whl-hl 阅读(176) 评论(0) 推荐(0)

383. Ransom Note
摘要:1. 问题描述 Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if 阅读全文

posted @ 2016-08-24 23:28 whl-hl 阅读(219) 评论(0) 推荐(0)

387. First Unique Character in a String
摘要:1. 问题描述 Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Note: You may assume the s 阅读全文

posted @ 2016-08-24 23:26 whl-hl 阅读(122) 评论(0) 推荐(0)

83. Remove Duplicates from Sorted List
摘要:1. 问题描述 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 阅读全文

posted @ 2016-08-24 23:24 whl-hl 阅读(132) 评论(0) 推荐(0)

101. Symmetric Tree
摘要:1. 问题描述 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). Note: Bonus points if you could solve it both r 阅读全文

posted @ 2016-08-20 23:43 whl-hl 阅读(169) 评论(0) 推荐(0)

198. House Robber
摘要:1. 问题描述 You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint sto 阅读全文

posted @ 2016-08-18 23:29 whl-hl 阅读(125) 评论(0) 推荐(0)

110. Balanced Binary Tree
摘要:1. 问题描述 Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which t 阅读全文

posted @ 2016-08-17 22:08 whl-hl 阅读(150) 评论(0) 推荐(0)

235. Lowest Common Ancestor of a Binary Search Tree
摘要:1. 问题描述 Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wi 阅读全文

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

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

posted @ 2016-08-09 22:21 whl-hl 阅读(111) 评论(0) 推荐(0)

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

posted @ 2016-08-09 22:07 whl-hl 阅读(114) 评论(0) 推荐(0)

141. Linked List Cycle
摘要:1. 问题描述 Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Tags: Linked List Two PointersSimi 阅读全文

posted @ 2016-08-08 23:34 whl-hl 阅读(112) 评论(0) 推荐(0)

70. Climbing Stairs
摘要:1. 问题描述 You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can 阅读全文

posted @ 2016-08-08 22:39 whl-hl 阅读(123) 评论(0) 推荐(0)

28. Implement strStr()
摘要:1. 问题描述 Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Tags:Two Pointers 阅读全文

posted @ 2016-08-06 23:23 whl-hl 阅读(171) 评论(0) 推荐(0)

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

posted @ 2016-08-05 23:22 whl-hl 阅读(169) 评论(0) 推荐(0)

对齐方式
摘要:参考资料: http://blog.csdn.net/jk110333/article/details/19237969 阅读全文

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

printf("%d, %d\n", i++, ++i)的输出结果是确定的吗???
摘要:1. 问题描述 以下代码的输出结果是什么? 题目1: 题目2: 2. 解题思路【错误】 printf参数是从右至左入栈的,故: 题目1的输出为:11,12 题目2的输出为: 3. 反思 注意:该类题目编译器不一样,结果就会不一样,即这种行为依赖编译器!!!不必纠结。 原因分析: C/C++语言没有规 阅读全文

posted @ 2016-08-03 06:52 whl-hl 阅读(5504) 评论(0) 推荐(0)

导航