上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 27 下一页
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo 阅读全文
posted @ 2017-05-14 17:26 wxquare 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using std::vector; 4 5 struct TreeNode { 6 int val; 7 TreeNode* left; 8 TreeNode* right; 9 TreeNode(int x) : 10 val(x), left(nullptr), ... 阅读全文
posted @ 2017-05-14 14:25 wxquare 阅读(246) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree, Return6. 阅读全文
posted @ 2017-05-14 13:36 wxquare 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 参考:白话经典算法系列之七 堆与堆排序 阅读全文
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) 编辑
摘要: 网易2016实习研发工程师编程题 有一棵二叉树,树上每个点标有权值,权值各不相同,请设计一个算法算出权值最大的叶节点到权值最小的叶节点的距离。二叉树每条边的距离为1,一个节点经过多少条边到达另一个节点为这两个节点之间的距离。 给定二叉树的根节点root,请返回所求距离。 阅读全文
posted @ 2017-05-12 22:36 wxquare 阅读(1329) 评论(0) 推荐(0) 编辑
摘要: 一.死锁 死锁指的是多个进程因为竞争资源,而造成相互等待的请款,在没外力的作用下,这些进程将永远处于阻塞状态。死锁产生必须满足下面四个条件: 二.死锁的解决 死锁产生有四个必要条件,只要破坏其中的任意一个条件,死锁就不会产生。一般而言解决死锁的方法分为预防、避免、检测与恢复。 阅读全文
posted @ 2017-05-11 15:17 wxquare 阅读(738) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 27 下一页