Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet... Read More
posted @ 2014-06-17 12:03 Xylophone Views(111) Comments(0) Diggs(0)
Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321Have you thought about this?Here are some good questions to ... Read More
posted @ 2014-06-17 10:53 Xylophone Views(215) Comments(0) Diggs(0)
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such po... Read More
posted @ 2014-06-17 08:49 Xylophone Views(669) Comments(2) Diggs(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... Read More
posted @ 2014-06-17 01:01 Xylophone Views(110) Comments(0) Diggs(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... Read More
posted @ 2014-06-17 00:49 Xylophone Views(141) Comments(0) Diggs(0)