- 博客(26)
- 资源 (1)
- 收藏
- 关注
原创 算法设计 《算法概论》第八章 8.10 习题解答
题目描述: Proving NP-completeness by generalization. For each of the problems below, prove that it is NPcomplete by showing that it is a generalization of some NP-complete problem we have seen in this ch
2017-06-23 12:44:21 625
原创 算法设计Week18 LeetCode Algorithms Problem #344 Integer Break
题目描述: Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get. For example, given n
2017-06-22 22:14:21 276
原创 算法设计Week17 LeetCode Algorithms Problem #264 Ugly Number II
题目描述: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the
2017-06-22 14:47:03 457
原创 算法设计Week16 LeetCode Algorithms Problem #322 Coin Change
题目描述: 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 make up that amount. If that amount of
2017-06-11 16:32:29 325
原创 算法设计Week15 LeetCode Algorithms Problem #120 Triangle
题目描述: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2],
2017-06-04 17:48:41 264
原创 算法设计Week14 LeetCode Algorithms Problem #91 Decode Ways
题目描述: A message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ -> 1 ‘B’ -> 2 … ‘Z’ -> 26 Given an encoded message containing digits, determi
2017-05-28 11:34:23 213
原创 算法设计Week13 LeetCode Algorithms Problem #64 Minimum Path Sum
题目描述: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or
2017-05-18 17:19:51 192
原创 算法设计Week12 LeetCode Algorithms Problem #63 Unique Paths II
题目描述: 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 as 1 and 0 respectivel
2017-05-10 18:14:49 224
原创 算法设计Week12 LeetCode Algorithms Problem #62 Unique Paths
题目描述: 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 robot is trying to r
2017-05-10 16:48:02 387
原创 算法设计Week11 LeetCode Algorithms Problem #304 Range Sum Query 2D - Immutable
题目描述: Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2). The above rectangle (with t
2017-05-07 20:03:50 318
原创 算法设计Week11 LeetCode Algorithms Problem #303 Range Sum Query - Immutable
题目描述: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -> 1 sumRange(2, 5)
2017-05-07 19:08:31 211
原创 算法设计Week10 LeetCode Algorithms Problem #213 House Robber II
题目描述: After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, all houses at this place are arranged
2017-04-30 22:42:15 228
原创 算法设计Week9 LeetCode Algorithms Problem #121. Best Time to Buy and Sell Stock
题目描述: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of th
2017-04-30 21:27:19 208
原创 算法设计Week8 LeetCode Algorithms Problem #198 House Robber
题目描述: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacen
2017-04-16 22:49:06 233
原创 算法设计Week8 LeetCode Algorithms Problem #70 Climbing Stairs
题目描述: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n wil
2017-04-16 22:00:46 228
原创 算法设计Week7 LeetCode Algorithms Problem #53 Maximum Subarray
题目描述: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2
2017-04-09 23:42:08 215
原创 算法设计Week6 LeetCode Algorithms Problem #455 Assign Cookies
题目描述: Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size o
2017-04-03 00:25:38 299
原创 CSI Tool获得数据内容
根据FAQ中的操作步骤,我们将在安装CSI Tool时已经下载好的linux-80211n-csitool-supplementary文件夹中的matlab文件夹以及前文中获得的csi.dat文件从Ubuntu系统中拷贝会Windows系统,使用MATLAB软件进行处理。 使用函数read_bf_file将数据从文件中读出,如:csi_trace = read_bf_file('csi.dat')
2017-03-28 16:10:55 13772 11
原创 CSI Tool的安装
本文记录了自己安装Linux 802.11n CSI Tool的点(xue)点(lei)滴滴。环境配置首先,需要一个Intel WiFi Link 5300无线网卡,网上卖的该型号网卡主要有两种接口:pci-ex1以及mini pci。前者可以很方便的插在台式机主机的扩展口上,后者一般是台式机或笔记本原装的网卡接口。购买网卡前最好先看一下机器上的接口是哪一种接口再购买。正常情况下,该网卡在插上后可以
2017-03-27 21:22:53 9705 17
原创 算法设计Week5 LeetCode Algorithms Problem #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 transactions as you like (i
2017-03-26 21:55:46 293
原创 算法设计Week4 LeetCode Algorithms Problem #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 express
2017-03-20 01:04:24 363
原创 算法设计Week3 LeetCode Algorithms Problem #133 Clone Graph
题目描述: Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ’s undirected graph serialization: Nodes are labeled uniquely. We use # as a separator for e
2017-03-11 20:57:54 301
原创 算法设计Week2 LeetCode Algorithms Problem #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. For example, Given [3,2,1,5,6,4] and k = 2, re
2017-03-03 19:42:29 272
原创 算法设计Week2 LeetCode #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 the majority
2017-03-02 17:26:41 239
原创 算法设计Week1 LeetCode Algorithms Problem #2 Add Two Numbers
题目描述 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and
2017-02-24 16:15:58 305
原创 算法设计Week1 LeetCode Algorithms Problem #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 may not use
2017-02-22 20:15:50 406
涉及6个嫌疑人的一桩疑案进分析
2012-10-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人