摘要: LeetCode——Hamming Distance Question The Hamming distance between two integers is the number of positions at which the corresponding bits are different 阅读全文
posted @ 2017-04-01 20:55 清水汪汪 阅读(148) 评论(0) 推荐(0) 编辑
摘要: LeetCode——Add Strings Question Given two non negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length 阅读全文
posted @ 2017-04-01 16:27 清水汪汪 阅读(178) 评论(0) 推荐(1) 编辑
摘要: ```C++ // 计算树的高度 int depth(TreeNode* root) { if (!root) { return 0; } else { int i = depth(root->left); int j = depth(root->right); ... 阅读全文
posted @ 2017-04-01 15:45 清水汪汪 阅读(1215) 评论(0) 推荐(1) 编辑
摘要: LeetCode——Diameter of Binary Tree Question Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary t 阅读全文
posted @ 2017-04-01 15:38 清水汪汪 阅读(150) 评论(0) 推荐(0) 编辑
摘要: LeetCode——Number of Boomerangs Question Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such 阅读全文
posted @ 2017-04-01 14:42 清水汪汪 阅读(141) 评论(0) 推荐(1) 编辑
摘要: 转载:http://blog.csdn.net/xiazdong 如果要转载,需要注明出处: http://blog.csdn.net/xiazdong 本文是 http://blog.csdn.net/xiazdong/article/details/7304239  阅读全文
posted @ 2017-03-22 22:45 清水汪汪 阅读(276) 评论(0) 推荐(1) 编辑
摘要: 转载自:http://www.cnblogs.com/shiyangxt/archive/2008/09/11/1289493.html 先MARK为敬 学无止境!!! 第一部分:(参考百度百科)  一、STL简介 STL(Standard Template Library,标准模板库)是 阅读全文
posted @ 2017-03-18 16:11 清水汪汪 阅读(639) 评论(0) 推荐(2) 编辑
摘要: LeetCode——Group Anagrams Question Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], 阅读全文
posted @ 2017-03-18 15:41 清水汪汪 阅读(182) 评论(0) 推荐(1) 编辑
摘要: LeetCode——Kth Largest Element in an Array Question Find the kth largest element in an unsorted array. Note that it is the kth largest element in the s 阅读全文
posted @ 2017-03-15 14:27 清水汪汪 阅读(150) 评论(0) 推荐(1) 编辑
摘要:  堆排序与快速排序,归并排序一样都是时间复杂度为O(N logN)的几种常见排序方法。学习堆排序前,先讲解下什么是数据结构中的二叉堆。二叉堆的定义二叉堆是完全二叉树或者是近似完全二叉树。二叉堆满足二个特性:1.父结点的键值总是大于或等于(小于或等于)任何一个子节点的键值。2.每个结点的左子 阅读全文
posted @ 2017-03-15 14:07 清水汪汪 阅读(5084) 评论(2) 推荐(1) 编辑