
算法设计与分析
文章平均质量分 87
Azu機
这个作者很懒,什么都没留下…
展开
-
算法设计与分析:Kth Largest Element in an Array(Week 2)
学号:16340008Question: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.Example 1:Input: [3,2,1,5,6,4]...原创 2018-09-15 00:00:07 · 198 阅读 · 0 评论 -
算法设计与分析:01 Matrix(Week 14)
学号:16340008题目:542. 01 MatrixQuestion:Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.The distance between two adjacent cells is 1.Example 1: Input:0 ...原创 2018-12-11 11:29:21 · 236 阅读 · 0 评论 -
算法设计与分析:Student Attendance Record II(Week 13)
学号:16340008题目:552. Student Attendance Record IIQuestion: Given a positive integer n, return the number of all possible attendance records with length n, which will be regarded as rewardable. Th...原创 2018-12-02 03:20:48 · 350 阅读 · 0 评论 -
算法设计与分析:Coin Change(Week 12)
学号:16340008题目:322. Coin ChangeQuestion:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to ...原创 2018-11-24 02:47:30 · 404 阅读 · 0 评论 -
算法设计与分析:Minimum Number of Refueling Stops(Week 11)
学号:16340008题目:871. Minimum Number of Refueling StopsQuestion:A car travels from a starting position to a destination which is target miles east of the starting position.Along the way, there ar...原创 2018-11-17 04:12:23 · 198 阅读 · 0 评论 -
算法设计与分析:New 21 Game(Week 10)
学号:16340008题目:837. New 21 GameQuestion:Alice plays the following game, loosely based on the card game "21".Alice starts with 0 points, and draws numbers while she has less than K points. Duri...原创 2018-11-08 02:17:29 · 269 阅读 · 0 评论 -
算法设计与分析:Edit Distance(Week 9)
学号:16340008题目:72. Edit DistanceQuestion: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 ...原创 2018-11-04 01:39:52 · 202 阅读 · 0 评论 -
算法设计与分析:Scramble String(Week 8)
学号:16340008题目:87. Scramble StringQuestion:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio...原创 2018-10-27 16:20:52 · 268 阅读 · 0 评论 -
算法设计与分析:Burst Balloons(Week 6)
学号:16340008题目:312. Burst BalloonsQuestion:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons....原创 2018-10-13 21:54:45 · 273 阅读 · 0 评论 -
算法设计与分析:Jump Game II(Week 7)
学号:16340008题目:Jump Game IIQuestion:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump ...原创 2018-10-17 21:23:51 · 226 阅读 · 0 评论 -
算法设计与分析:Word Ladder(Week 4)
学号:16340008题目:127. Word LadderQuestion:Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such ...原创 2018-09-27 18:36:26 · 5092 阅读 · 0 评论 -
算法设计与分析:Surrounded Regions(Week 3)
学号:16340008Question:Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region....原创 2018-09-21 14:13:54 · 209 阅读 · 0 评论 -
算法设计与分析:K-Similar Strings(Week 5)
学号:16340008题目:854. K-Similar StringsQuestion: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 resultin...原创 2018-10-03 20:06:23 · 332 阅读 · 0 评论 -
算法设计与分析:Jewels and Stones(Week 1)
学号:16340008Question:You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in Sis a type of stone you have. You want to k...原创 2018-09-05 23:17:19 · 197 阅读 · 0 评论 -
Capacitated Facility Location Problem (Algorithm Design and Analysis Project)
学号:16340008目录QuestionAnswer算法①:模拟退火算法 算法②:贪心算法 CommentsReferenceQuestion:Suppose there are n facilities and m customers. We wish to choose:which of the n facilities to open the as...原创 2018-12-23 18:27:23 · 253 阅读 · 0 评论