摘要: 转八大排序算法概述排序有内部排序和外部排序,内部排序是数据记录在内存中进行排序,而外部排序是因排序的数据很大,一次不能容纳全部的排序记录,在排序过程中需要访问外存。我们这里说说八大排序就是内部排序。当n较大,则应采用时间复杂度为O(nlog2n)的排序方法:快速排序、堆排序或归并排序序。 快速排序:... 阅读全文
posted @ 2015-03-18 20:46 hongchun_z 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le... 阅读全文
posted @ 2015-03-18 17:36 hongchun_z 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2015-03-18 14:59 hongchun_z 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,... 阅读全文
posted @ 2015-03-18 14:41 hongchun_z 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2015-03-18 11:40 hongchun_z 阅读(2545) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan... 阅读全文
posted @ 2015-03-18 10:50 hongchun_z 阅读(128) 评论(0) 推荐(0) 编辑