上一页 1 2 3 4 5 6 7 ··· 17 下一页

快速排序之单项扫描法

摘要: 快速排序是排序算法中最受青睐的算法之一,相对于堆排序和归并排序而言,即便具有相同的复杂度O(NlogN)。面对大数据而言,快排的效率也更高。一般而言,数据结构中的排序算法都是采取的双向指针法。在之前写的一篇博文《排序算法(初级版)之快排、归并、堆排序》中已经有过总结。这里就不再啰嗦了。本篇博文主要讲... 阅读全文
posted @ 2014-08-22 17:00 喵星人与汪星人 阅读(1784) 评论(0) 推荐(0) 编辑

[leetcode]Convert Sorted List to Binary Search Tree

摘要: Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.... 阅读全文
posted @ 2014-08-16 10:51 喵星人与汪星人 阅读(311) 评论(0) 推荐(0) 编辑

[leetcode]Minimum Path Sum

摘要: Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along ... 阅读全文
posted @ 2014-08-16 00:58 喵星人与汪星人 阅读(198) 评论(0) 推荐(0) 编辑

[leetcode]Sum Root to Leaf Numbers

摘要: Sum Root to Leaf NumbersGiven a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-l... 阅读全文
posted @ 2014-08-16 00:45 喵星人与汪星人 阅读(204) 评论(0) 推荐(0) 编辑

[leetcode]Unique Binary Search Trees

摘要: Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a to... 阅读全文
posted @ 2014-08-16 00:38 喵星人与汪星人 阅读(159) 评论(0) 推荐(0) 编辑

[leetcode]Valid Number

摘要: Valid NumberValidate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the ... 阅读全文
posted @ 2014-08-16 00:02 喵星人与汪星人 阅读(765) 评论(0) 推荐(0) 编辑

[leetcode]Unique Binary Search Trees II

摘要: Unique Binary Search Trees IIGivenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your pr... 阅读全文
posted @ 2014-08-15 22:55 喵星人与汪星人 阅读(281) 评论(0) 推荐(0) 编辑

[leetcode]Interleaving String

摘要: Interleaving StringGivens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", r... 阅读全文
posted @ 2014-08-15 21:25 喵星人与汪星人 阅读(393) 评论(0) 推荐(0) 编辑

[leetcode]Minimum Window Substring

摘要: Minimum Window SubstringGiven 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).Fo... 阅读全文
posted @ 2014-08-15 17:04 喵星人与汪星人 阅读(316) 评论(0) 推荐(0) 编辑

[leetcode]Spiral Matrix

摘要: Spiral MatrixGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[... 阅读全文
posted @ 2014-08-15 15:55 喵星人与汪星人 阅读(209) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 17 下一页