![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法分析与设计课程作业
!&?
这个作者很懒,什么都没留下…
展开
-
算法——Week17
45. Jump Game II 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 length at that position. ...原创 2018-12-30 10:39:06 · 100 阅读 · 0 评论 -
算法——Week 1
1.Two Sum 问题描述 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you ma...原创 2018-09-09 09:49:23 · 134 阅读 · 0 评论 -
算法——Week 2
169. Majority Element Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and th...原创 2018-09-14 10:03:53 · 120 阅读 · 0 评论 -
算法——Week3
22. 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: [ “((()))”, “(()())”, “(()...原创 2018-12-26 15:07:54 · 112 阅读 · 0 评论 -
算法——Week4
771. Jewels and Stones You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to k...原创 2018-12-27 08:56:35 · 111 阅读 · 0 评论 -
算法——Week5
938. Range Sum of BST Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive). The binary search tree is guaranteed to have unique val...原创 2018-12-27 09:29:11 · 154 阅读 · 0 评论 -
算法——Week6
841.Keys and Rooms There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, …, N-1, and each room may have some keys to access the next room. Formally, each room i has a...原创 2018-10-14 11:43:00 · 121 阅读 · 0 评论 -
算法——Week 7
684.Redundant Connection In this problem, a tree is an undirected graph that is connected and has no cycles. The given input is a graph that started as a tree with N nodes (with distinct values 1, 2, ...原创 2018-10-15 23:29:04 · 197 阅读 · 0 评论 -
算法——Week8
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 target node, and w ...原创 2018-12-26 09:47:54 · 219 阅读 · 0 评论 -
算法——Week9
687. Longest Univalue Path Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root. Note: The length of ...原创 2018-12-27 10:45:33 · 97 阅读 · 0 评论 -
算法——Week10
207. Course Schedule There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is...原创 2018-12-27 18:25:18 · 136 阅读 · 0 评论 -
算法——Week11
210. Course Schedule II There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which...原创 2018-12-28 08:34:38 · 145 阅读 · 0 评论 -
算法——Week12
104. Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Note: ...原创 2018-12-28 09:17:30 · 114 阅读 · 0 评论 -
算法——Week13
406. Queue Reconstruction by Height Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is th...原创 2018-12-28 18:07:02 · 88 阅读 · 0 评论 -
算法——Week14
122. Best Time to Buy and Sell Stock II Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many...原创 2018-12-29 09:08:01 · 119 阅读 · 0 评论 -
算法——Week15
134. Gas Station There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from s...原创 2018-12-29 10:02:09 · 168 阅读 · 0 评论 -
算法——Week16
55. Jump Game 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 length at that position. Det...原创 2018-12-29 10:56:42 · 94 阅读 · 0 评论 -
算法——project
Capacitated Facility Location Problem 问题描述 Suppose there are n facilities and m customers. We wish to choose: (1) which of the n facilities to open (2) the assignment of customers to facilities The o...原创 2018-12-21 12:18:53 · 251 阅读 · 1 评论