摘要: Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2014-05-21 23:07 Sara Chi 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1... 阅读全文
posted @ 2014-05-21 23:02 Sara Chi 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321 1 class Solution { 2 public: 3 int reverse(int x) { 4 ... 阅读全文
posted @ 2014-05-21 22:58 Sara Chi 阅读(250) 评论(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 an... 阅读全文
posted @ 2014-05-21 22:52 Sara Chi 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 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 farthest le... 阅读全文
posted @ 2014-05-21 22:47 Sara Chi 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity... 阅读全文
posted @ 2014-05-21 22:40 Sara Chi 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the". 1 Class Solution{ 2 public: ... 阅读全文
posted @ 2014-05-21 21:10 Sara Chi 阅读(149) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-05-21 20:41 Sara Chi 阅读(12) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2014-04-28 10:50 Sara Chi 阅读(3) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2014-03-17 16:01 Sara Chi 阅读(0) 评论(0) 推荐(0) 编辑