2015年8月2日

二叉搜索树

摘要: 文章转载自:http://www.cnblogs.com/elaron/archive/2013/04/11/3015155.html结构特点二叉搜索树的特点是,小的值在左边,大的值在右边,即比如:这样的结构有一个好处是很容易获得最大值(Maximum)、最小值(minimum)、某元素的前驱(Pr... 阅读全文

posted @ 2015-08-02 17:41 Wrench 阅读(80) 评论(0) 推荐(0) 编辑

235 Lowest Common Ancestor of a Binary Search Tree

摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedia... 阅读全文

posted @ 2015-08-02 16:59 Wrench 阅读(175) 评论(0) 推荐(0) 编辑

242 Valid Anagram

摘要: Description:Given two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s= "rat",t= ... 阅读全文

posted @ 2015-08-02 13:48 Wrench 阅读(126) 评论(0) 推荐(0) 编辑

leetcode记录说明

摘要: leetcode是一个在线算法测试网站,上面有很多经典的算法题目,经常会在程序员面试中出现。 作为一个初级coder,这些题目对我的提升还是很大的。我准备做完上面的题目后,记录在这里,也算是挺有意思的一件事。 目前已经做过了42道题,这些我有的代码已经丢失,等最终全部做完有时间再重新做。 ... 阅读全文

posted @ 2015-08-02 13:45 Wrench 阅读(138) 评论(0) 推荐(0) 编辑

导航