摘要:
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文
posted @ 2015-08-05 21:39
鸭子船长
阅读(148)
评论(0)
推荐(0)
摘要:
转自:http://blog.csdn.net/tuhuolong/article/details/6844850树的旋转,分为左旋和右旋,以下借助图来做形象的解释和介绍:1.左旋(右子为轴,当前结点左旋)如上图所示:当在某个结点pivot上,做左旋操作时,我们假设它的右孩子y不是NIL[T],pi... 阅读全文
posted @ 2015-08-05 20:14
鸭子船长
阅读(2174)
评论(0)
推荐(0)
摘要:
转自:http://www.cnblogs.com/fornever/archive/2011/12/02/2270692.html红黑树之前看了很多写红黑树的博客,但是感觉都讲的不太清楚!没说这样操作如何使他保持平衡的,于是疑惑重重,就看不下去了,一次不经意看到一个人说维基百科的红黑树讲的好,我就... 阅读全文
posted @ 2015-08-05 20:13
鸭子船长
阅读(246)
评论(0)
推荐(0)
摘要:
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA... 阅读全文
posted @ 2015-08-05 15:22
鸭子船长
阅读(486)
评论(0)
推荐(0)