Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n)
space is pretty straight forward. Could you devis...
分类:
其他好文 时间:
2014-12-01 22:34:27
阅读次数:
309
Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
public class...
分类:
其他好文 时间:
2014-12-01 22:30:11
阅读次数:
201
Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elemen...
分类:
其他好文 时间:
2014-12-01 22:17:26
阅读次数:
237
Update 19th November 2014: Updated for Xcode 6.1. Learn how to make your apps use Adaptive Layout in iOS 8! Note from Ray: This is an abbreviated version of a chapter from?iOS 8 by Tutorials?rel...
分类:
其他好文 时间:
2014-12-01 16:27:32
阅读次数:
297
Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp...
分类:
其他好文 时间:
2014-12-01 12:50:34
阅读次数:
155
Givenanarraywithnobjectscoloredred,whiteorblue,sortthemsothatobjectsofthesamecolorareadjacent,withthecolorsintheorderred,whiteandblue.Here,wewillusetheintegers0,1,and2torepresentthecolorred,white,andbluerespectively.Note:Youarenotsupposetousethelibrary‘ssor..
分类:
其他好文 时间:
2014-11-30 17:10:10
阅读次数:
148
loaddatalocalinpathoverwriteintotablestudent;关键字local表明数据从localdisk中读取,如果没有此关键字,则数据从hdfs中读龋关键字keyword表明先删除表中的数据,然后再插入数据。如果没有这个关键字,则表明是append的方式。Note:1.load不会检验要load的data是否符合shema..
分类:
其他好文 时间:
2014-11-30 17:08:30
阅读次数:
153
Construct Binary Tree from Preorder and Inorder TraversalGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume...
分类:
其他好文 时间:
2014-11-30 16:46:40
阅读次数:
150
Construct Binary Tree from Inorder and Postorder TraversalGiven inorder and postorder traversal of a tree, construct the binary tree.Note:You may assu...
分类:
其他好文 时间:
2014-11-30 15:20:40
阅读次数:
128
http://cds.linear.com/docs/cn/design-note/DN317%20sim_chs.pdfhttp://cds.linear.com/docs/en/datasheet/1961fa.pdf
分类:
其他好文 时间:
2014-11-29 20:15:33
阅读次数:
159