摘要: 参考:白话经典算法系列之七 堆与堆排序 阅读全文
posted @ 2017-05-13 21:00 wxquare 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 给定一个整数数组,a[1],a[2],...,a[n],每一个元素a[i]可以和它右边的(a[i+1],a[i+2],...,a[n])元素做差,求这个数组中最大的差值,例如a={0,3,9,1,3,5}这个数组最大的差值就是9-1=8; class Solution { public: int m 阅读全文
posted @ 2017-05-13 16:56 wxquare 阅读(1337) 评论(0) 推荐(0) 编辑
摘要: 1.Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 2.Given a linked list, return the node 阅读全文
posted @ 2017-05-13 11:57 wxquare 阅读(338) 评论(0) 推荐(0) 编辑
摘要: Lowest Common Ancestor of a Binary Tree(二叉树的最近公共父亲节点) Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. Accor 阅读全文
posted @ 2017-05-13 11:49 wxquare 阅读(1393) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: 阅读全文
posted @ 2017-05-13 11:35 wxquare 阅读(418) 评论(0) 推荐(0) 编辑