http://acm.hdu.edu.cn/showproblem.php?pid=1385
求最短路,要求输出字典序最小的路径。
spfa:拿一个pre[]记录前驱,不同的是在松弛的时候,要考虑和当前点的dis值相等的情况,解决的办法是dfs找出两条路径中字典序较小的,pre[]去更新。把路径当做字符串处理。
我只用之前的pre去更新当前点,并没考虑到起点到当前点的整个路径...
分类:
其他好文 时间:
2014-05-19 22:49:45
阅读次数:
383
Apache Module mod_reqtimeoutAvailable
Languages:enDescription:Set timeout and minimum data rate for receiving
requestsStatus:ExtensionModuleIdentifier...
分类:
其他好文 时间:
2014-05-19 19:31:41
阅读次数:
310
Construct Binary Tree from Preorder and Inorder
TraversalGiven preorder and inorder traversal of a tree, construct the binary
tree.Note:You may assume...
分类:
其他好文 时间:
2014-05-19 18:43:40
阅读次数:
177
求树的最大路径和(Binary Tree Maximum Path Sum)...
分类:
其他好文 时间:
2014-05-18 18:25:41
阅读次数:
235
Binary Tree Level Order Traversal
Total Accepted: 12441 Total
Submissions: 40879My Submissions
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left t...
分类:
其他好文 时间:
2014-05-18 10:11:13
阅读次数:
337
对于本题,想到一个中序遍历后,判别是否为回文串的方法,却WA多次
class Solution {
public:
vector vectorValue;
void inOrder(TreeNode* root)
{
if(root!=NULL)
{
inOrder(root->left);...
分类:
其他好文 时间:
2014-05-18 06:38:58
阅读次数:
294
由于我想在页面加载完成后,有几个地方显示当前时间,所以我需要给多个span赋值。
span代码的写法如下: (多个span)
jQuery写法:
$(document).ready(function() { //获取当前时间比如:2014年5月17日(js自带的方法)
var currentDate = new Date().toLocaleDateStri...
分类:
Web程序 时间:
2014-05-18 04:49:05
阅读次数:
322
1、
??
Path Sum
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.
For example:
Given the below...
分类:
其他好文 时间:
2014-05-18 03:25:06
阅读次数:
301
Given a triangle, find the minimum path sum
from top to bottom. Each step you may move to adjacent numbers on the row
below.For example, given the fol...
分类:
其他好文 时间:
2014-05-18 02:11:19
阅读次数:
302
红黑树概念
特殊的二叉查找树,每个节点上都有存储位表示节点的颜色是红(Red)或黑(Black)。时间复杂度是O(lgn),效率高。 特性:
(1)每个节点或者是黑色,或者是红色。 (2)根节点是黑色。 (3)每个叶子节点(NIL)是黑色。(只为空(NIL或null)的节点)
(4)如果一个节点是红...
分类:
其他好文 时间:
2014-05-18 01:38:25
阅读次数:
611