- 博客(24)
- 收藏
- 关注
原创 《算法概论》课后证明题作业
《算法概论》课后证明题作业题目 8.14给定一个无向图G =(V,E)和整数k,求G中一个规模为k的团以及一个规模为k的独立集。假定它们都是存在的。证明要求规模为k的团,意思就是求出G中k个顶点使得它们之间两两存在相连的边。为此我们先假设要求任意图中大小为k的团,可以在此图中添加k个顶点,顶点间相互独立,得到新图G’来开始我们的证明。 G’中k个独立的顶点形成大小为
2018-01-21 22:46:32
834
原创 Partition Equal Subset Sum
Partition Equal Subset SumA.题意 Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is
2018-01-21 22:21:03
216
原创 Counting Bits
Counting BitsA.题意 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 array.
2018-01-21 22:05:48
193
原创 Find Bottom Left Tree Value
Find Bottom Left Tree ValueA.题意 Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3 Output: 1 Example 2:
2018-01-21 21:48:29
215
原创 Network Delay Time
Network Delay TimeA.题意 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
2018-01-21 21:35:26
225
原创 Monotone Increasing Digits
Monotone Increasing DigitsA.题意 Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. (Recall that an integer has monoton
2018-01-21 21:23:44
164
原创 Target Sum
Target SumA.题意 Follow up for “Unique Paths”: You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should ch
2018-01-21 00:29:03
169
原创 Unique Paths II
Unique Paths IIA.题意 Follow up for “Unique Paths”: Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space is marked a
2018-01-21 00:12:33
147
原创 Unique Paths
Unique PathsA.题意 A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point in time. The ro
2018-01-20 23:26:54
143
原创 Jump Game II
Jump Game IIA.题意 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 th
2018-01-13 10:22:07
158
原创 Maximum Sum of 3 Non-Overlapping Subarrays
Maximum Sum of 3 Non-Overlapping Subarrays
2017-12-18 18:33:29
222
原创 Best Time to Buy and Sell Stock with Transaction Fee
leetcode : Best Time to Buy and Sell Stock with Transaction Fee
2017-12-04 16:18:20
236
原创 LeetCode : Minimum Number of Arrows to Burst Balloons
Minimum Number of Arrows to Burst Balloons
2017-10-30 17:14:52
215
原创 分治与动态规划之Burst Balloons问题
Burst BalloonsA.题意 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. If the you burst balloon i
2017-10-09 18:59:23
342
原创 图算法
图算法1.关于拓扑序( 207. Course Schedule)a.题意 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 firs
2017-09-24 19:46:17
243
原创 week1
Median of Two Sorted Arrays (from leetCode)A.题意 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
2017-09-10 13:00:50
344
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人