2015年5月23日

单源最短路径问题 Dijkstra 贪心法

摘要: 一维数组d[i]中存放从原点s到结点i的当前最短路径的长度;一维整型数组path[i]存放从原点到结点i的当前最短路径上,结点i的前一个结点。程序如下:#include#include#include#include#include#includeusing namespace std;const ... 阅读全文

posted @ 2015-05-23 19:33 Tob__yuhong 阅读(171) 评论(0) 推荐(0)

单源最短路径问题 Dijkstra 贪心法

摘要: 一维数组d[i]中存放从原点s到结点i的当前最短路径的长度;一维整型数组path[i]存放从原点到结点i的当前最短路径上,结点i的前一个结点。程序如下:#include#include#include#include#include#includeusing namespace std;const ... 阅读全文

posted @ 2015-05-23 19:33 Tob__yuhong 阅读(204) 评论(0) 推荐(0)

LeetCode | Remove Element

摘要: Remove ElementTotal Accepted:56056Total Submissions:172938My SubmissionsQuestionSolutionGiven an array and a value, remove all instances of that value... 阅读全文

posted @ 2015-05-23 16:49 Tob__yuhong 阅读(140) 评论(0) 推荐(0)

LeetCode | Remove Element

摘要: Remove ElementTotal Accepted:56056Total Submissions:172938My SubmissionsQuestionSolutionGiven an array and a value, remove all instances of that value... 阅读全文

posted @ 2015-05-23 16:49 Tob__yuhong 阅读(130) 评论(0) 推荐(0)

LeetCode | Reverse Integer

摘要: Reverse IntegerTotal Accepted:72743Total Submissions:279370My SubmissionsQuestionSolutionReverse digits of an integer.Example1:x = 123, return 321Exam... 阅读全文

posted @ 2015-05-23 16:15 Tob__yuhong 阅读(133) 评论(0) 推荐(0)

LeetCode | Reverse Integer

摘要: Reverse IntegerTotal Accepted:72743Total Submissions:279370My SubmissionsQuestionSolutionReverse digits of an integer.Example1:x = 123, return 321Exam... 阅读全文

posted @ 2015-05-23 16:15 Tob__yuhong 阅读(155) 评论(0) 推荐(0)

LeetCode | Count Primes

摘要: Count PrimesTotal Accepted:10553Total Submissions:56521My SubmissionsQuestionSolutionDescription:Count the number of prime numbers less than a non-neg... 阅读全文

posted @ 2015-05-23 14:43 Tob__yuhong 阅读(104) 评论(0) 推荐(0)

LeetCode | Count Primes

摘要: Count PrimesTotal Accepted:10553Total Submissions:56521My SubmissionsQuestionSolutionDescription:Count the number of prime numbers less than a non-neg... 阅读全文

posted @ 2015-05-23 14:43 Tob__yuhong 阅读(148) 评论(0) 推荐(0)

求最大最小元 C++实现 分治法

摘要: 采用分治法在一个元素集合中寻找最大元素和最小元素。程序实现:#include#include#includeusing namespace std;const int N=1000;int mini,maxi;int l[N];void maxMin(int i,int j,int &max,int... 阅读全文

posted @ 2015-05-23 13:15 Tob__yuhong 阅读(310) 评论(0) 推荐(0)

求最大最小元 C++实现 分治法

摘要: 采用分治法在一个元素集合中寻找最大元素和最小元素。程序实现:#include#include#includeusing namespace std;const int N=1000;int mini,maxi;int l[N];void maxMin(int i,int j,int &max,int... 阅读全文

posted @ 2015-05-23 13:15 Tob__yuhong 阅读(149) 评论(0) 推荐(0)

求最大最小元 C++实现 分治法

摘要: 采用分治法在一个元素集合中寻找最大元素和最小元素。程序实现:#include#include#includeusing namespace std;const int N=1000;int mini,maxi;int l[N];void maxMin(int i,int j,int &max,int... 阅读全文

posted @ 2015-05-23 13:15 Tob__yuhong 阅读(180) 评论(0) 推荐(0)

Shell 三个小程序

摘要: 运行环境:Ubuntu12.04 bin/bash1.比较两个数的大小#!bin.bash#script4.4.shtecho "Enter the first integer:"read first echo "Enter the second integer:"read secondif [ "... 阅读全文

posted @ 2015-05-23 10:01 Tob__yuhong 阅读(140) 评论(0) 推荐(0)

Shell 三个小程序

摘要: 运行环境:Ubuntu12.04 bin/bash1.比较两个数的大小#!bin.bash#script4.4.shtecho "Enter the first integer:"read first echo "Enter the second integer:"read secondif [ "... 阅读全文

posted @ 2015-05-23 10:01 Tob__yuhong 阅读(109) 评论(0) 推荐(0)

Shell 三个小程序

摘要: 运行环境:Ubuntu12.04 bin/bash1.比较两个数的大小#!bin.bash#script4.4.shtecho "Enter the first integer:"read first echo "Enter the second integer:"read secondif [ "... 阅读全文

posted @ 2015-05-23 10:01 Tob__yuhong 阅读(92) 评论(0) 推荐(0)

Shell 三个小程序

摘要: 运行环境:Ubuntu12.04 bin/bash1.比较两个数的大小#!bin.bash#script4.4.shtecho "Enter the first integer:"read first echo "Enter the second integer:"read secondif [ "... 阅读全文

posted @ 2015-05-23 10:01 Tob__yuhong 阅读(130) 评论(0) 推荐(0)

导航