![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 79
A_bigUncle
这个作者很懒,什么都没留下…
展开
-
Huffman Tree
Huffman Tree标签(空格分隔): 算法、HuffmanHuffman Tree & Huffman CodingGiven a sequence of weight, then build a Huffman Tree with this sequence. Or Given a sequence of string(only from ‘a’ to ‘z’), then build a原创 2017-05-24 21:30:43 · 517 阅读 · 0 评论 -
[Week 14] LeetCode 23. Merge k Sorted Lists
LeetCode 23. Merge k Sorted Lists问题描述Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.ExampleInput:[ 1->4->5, 1->3->4, 2->6]...原创 2018-12-09 18:42:27 · 163 阅读 · 0 评论 -
[Week 13] LeetCode 338. Counting Bits
LeetCode 338. Counting Bits问题描述Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an ...原创 2018-12-02 19:33:17 · 207 阅读 · 0 评论 -
[Week 11] LeetCode 403. Frog Jump
LeetCode 403. Frog Jump问题描述A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into ...原创 2018-11-18 18:46:32 · 341 阅读 · 0 评论 -
[Week 9] LeetCode 72. Edit Distance
LeetCode 72. Edit Distance问题描述Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2.You have the following 3 operations permitted on a word:Ins...原创 2018-11-04 17:01:48 · 171 阅读 · 0 评论 -
[Week 10] LeetCode 32. Longest Valid Parentheses
LeetCode 32. Longest Valid Parentheses问题描述Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.示例Example 1Input: "((...原创 2018-11-09 20:04:44 · 159 阅读 · 0 评论 -
[Week 7] LeetCode 45 & 55. Jump Game I & II
LeetCode 45 & 55. Jump Game I & IIJump Game IGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your ...原创 2018-10-20 18:33:34 · 192 阅读 · 0 评论 -
[Week 6] LeetCode 4. Median of Two Sorted Arrays
LeetCode 4. Median of Two Sorted Arrays问题描述There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should ...原创 2018-10-14 16:47:47 · 153 阅读 · 0 评论 -
[Week 5] LeetCode 854. K-Similar Strings
LeetCode 854. K-Similar Strings问题描述:Strings A and B are K-similar (for some non-negative integer K) if we can swap the positions of two letters in A exactly K times so that the resulting string equa...原创 2018-10-07 19:26:00 · 399 阅读 · 0 评论 -
[Week 4] LeetCode 743. Network Delay Time
LeetCode 743. Network Delay Time问题描述:There are N network nodes, labelled 1 to N.Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v is the targ...原创 2018-09-28 15:39:08 · 253 阅读 · 0 评论 -
[Week 3] LeetCode 785. Is Graph Bipartite?
LeetCode 785. Is Graph Bipartite?问题描述:Given an undirected graph, return true if and only if it is bipartite.Recall that a graph is bipartite if we can split it’s set of nodes into two independent s...原创 2018-09-22 10:12:11 · 215 阅读 · 0 评论 -
[Week 2] LeetCode 335. Count of Smaller Numbers After Self
LeetCode 335. Count of Smaller Numbers After Self问题描述:You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number...原创 2018-09-15 15:36:31 · 196 阅读 · 0 评论 -
[Week 1] LeetCode 215. Kth Largest Element in an Array
LeetCode 215. Kth Largest Element in an Array问题描述:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.输入示...原创 2018-09-08 22:19:20 · 169 阅读 · 0 评论 -
Prim算法最小生成树c++实现
Prim算法最小生成树c++实现标签(空格分隔): Prim 算法 c++最近离散课上讲到了Prim算法实现最小生成树,现在用c++来实现。本文代码来源于乔帮主伪代码。简述对于给定的带权图G,为了使得生成树T的权w(T)最小,我们可以使用贪心算法。求最小生成树的贪心法:1.选择一个初始点v1v_1; 2.为了使得生成树的权极小化,选择v1v_1的最小权邻点,并将其连接到v1v_1; 3.选择{v原创 2017-05-17 23:51:34 · 2354 阅读 · 0 评论 -
Capacity Facility Location Problem
文章目录Capacity Facility Location ProblemCFLP方案贪心算法局部搜索法模拟退火效果代码贪心算法局部搜索模拟退火目前最优解Capacity Facility Location ProblemCFLPCapacity Facility Location Problem,即有容量限制的设施选址问题,更准确地说,这次解决的问题为 SSCFLP(Single Sou...原创 2018-12-23 09:47:24 · 1617 阅读 · 0 评论