摘要:
什么是Bellman-Ford算法? Bellman-Ford,是求解单源最短路经问题的一种算法,由Richard Bellman和莱斯特.福特创立的。它的原理是对图进行|V|-1次松弛操作,得到所有可能的最短路经。其优于Dijkstra的方面是边的权值可以为负数、实现简单,缺点是时间复杂度高,高达 阅读全文
摘要:
package LeetCode_941 /** * 941. Valid Mountain Array * https://leetcode.com/problems/valid-mountain-array/description/ * * Given an array A of integer 阅读全文
摘要:
package LeetCode_1475 import java.util.* /** * 1475. Final Prices With a Special Discount in a Shop * https://leetcode.com/problems/final-prices-with- 阅读全文
摘要:
package LeetCode_282 /** * 282. Expression Add Operators * https://leetcode.com/problems/expression-add-operators/description/ * * Given a string that 阅读全文
摘要:
package LeetCode_503 import java.util.* /** * 503. Next Greater Element II * https://leetcode.com/problems/next-greater-element-ii/description/ * * Gi 阅读全文
摘要:
package LeetCode_227 import java.util.* /** * 227. Basic Calculator II * https://leetcode.com/problems/basic-calculator-ii/description/ * * Implement 阅读全文
摘要:
package LeetCode_224 import java.util.* /** * 224. Basic Calculator * https://leetcode.com/problems/basic-calculator/description/ * * Implement a basi 阅读全文
摘要:
package LeetCode_40 /** * 40. Combination Sum II * https://leetcode.com/problems/combination-sum-ii/description/ * * Given a collection of candidate n 阅读全文
摘要:
package _interview_question /** * Check if a given target element is found in the infinite long sorted array. * */ class Solution8 { /** * solution: b 阅读全文
摘要:
package LeetCode_280 /** * 280. Wiggle Sort * (locked by leetcode) * https://www.lintcode.com/problem/wiggle-sort/description * * Given an unsorted ar 阅读全文