2014年11月5日

Balanced Binary Tree

摘要: 这几天A的都是二叉树的,如果输的基本操作掌握了,用递归很好解决这些题目的。这个可能不是最好的解法,明天再去Discuss看看有没有好的解法Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For t... 阅读全文

posted @ 2014-11-05 22:28 luckygxf 阅读(134) 评论(0) 推荐(0) 编辑

快速排序QuickSort

摘要: 前几天实现了直接插入排序、冒泡排序和直接选择排序这三个基础排序。今天看了一下冒泡排序的改进算法,快速排序。单独记录一下,后面还有归并和基数排序等快速排序1.选择一个支点默认为数组第一个元素及array[start]作为支点,将所有大于支点元素的值放到支点后面,将所有小于支点元素的值放到支点前面,完成... 阅读全文

posted @ 2014-11-05 21:18 luckygxf 阅读(276) 评论(0) 推荐(0) 编辑

Minimum Depth of Binary Tree

摘要: Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root... 阅读全文

posted @ 2014-11-05 10:52 luckygxf 阅读(175) 评论(0) 推荐(0) 编辑

导航