uva 331 Mapping the Swaps
Sorting an array can be done by swapping certain pairs of adjacent entries in the array. This is the fundamental technique used in the well-known bubble sort. If we li...
分类:
移动开发 时间:
2015-02-02 18:07:12
阅读次数:
179
题目链接:Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use...
分类:
其他好文 时间:
2015-02-01 17:49:12
阅读次数:
174
描述:
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant...
分类:
其他好文 时间:
2015-02-01 12:12:19
阅读次数:
156
题目链接:Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(...
分类:
其他好文 时间:
2015-01-31 14:46:33
阅读次数:
141
对于全源最短路径问题(All-Pairs Shortest Paths Problem),可以认为是单源最短路径问题的推广,即分别以每个顶点作为源顶点并求其至其它顶点的最短距离。Johnson 算法描述如下:给定图 G = (V, E),增加一个新的顶点 s,使 s 指向图 G 中的所有顶点都建立连...
分类:
编程语言 时间:
2015-01-31 10:33:14
阅读次数:
329
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/43302355
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm...
分类:
其他好文 时间:
2015-01-30 09:01:47
阅读次数:
177
题目:
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant...
分类:
其他好文 时间:
2015-01-29 17:37:16
阅读次数:
111
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(())", "...
分类:
编程语言 时间:
2015-01-29 12:43:04
阅读次数:
157
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'24: Swap Nodes in Pairshttps://oj.leetcode.com/problems/swap-nodes-in-pairs/Given a linked...
分类:
编程语言 时间:
2015-01-29 01:23:35
阅读次数:
178
题目:
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(()...
分类:
其他好文 时间:
2015-01-25 21:05:00
阅读次数:
171