自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 资源 (3)
  • 收藏
  • 关注

原创 自己写的一个爬蚂蜂窝的景点数据的Python程序,Mark一下

#!/usr/bin python#coding:utf-8import sysreload(sys)sys.setdefaultencoding("utf-8")import requestsimport reimport tracebackdef print_fun(entity): for k in entity: print "%s\t%s"%(k,en

2017-09-27 13:55:17 437

原创 证明题-算法概论8.3吝啬SAT问题证明

问题描述吝啬SAT问题是这样的:给定一组子句(每个子句都是其中文字的析取)和整数k,求一个最多有k个变量为true的满足赋值——如果该赋值存在。证明吝啬问题是NP-完全问题。解题思路1.什么是SAT问题假设我们有这样一组子句: (a⋃b⋃c)⋂(a⋃b¯)⋂(b⋃c¯)(a¯⋂c)⋂(a¯⋃b¯⋃c¯) 我们需要做的就是找到a,b,c的取值(true or false)使得该表达式的结果是tr

2017-06-29 23:23:23 362

原创 sicily考试模拟题-1003相连的1 1004isDAG? 1005相邻的数 1006单词变换

1003相连的1题目描述对于一个01矩阵A,求其中有多少片连成一片的1. 每个1可以和上下左右的1相连.请为下面的Solution类实现解决这一问题的函数countConnectedOnes,函数参数A为给出的01矩阵,A的行数和列数均不大于1000. 函数的返回值是问题的答案.class Solution {public: int countConnectedOnes(vector<ve

2017-06-29 18:38:38 373

原创 sicily考试模拟题-1000超级和 1001会议室安排 1002二叉树比较

1000题目描述Description定义超级和函数F如下:F(0, n) = n,对于所有的正整数n..F(k, n) = F(k – 1, 1) + F(k – 1, 2) + … + F(k – 1, n),对于所有的正整数k和n.请实现下面Solution类中计算F(k, n)的函数(1 <= k, n <= 14).class Solution {public: int

2017-06-29 18:26:07 282

原创 leetCode刷题归纳-linked list(141. Linked List Cycle&& Add to List 142. Linked List Cycle II)

这一题还蛮有意思的,虽然不太复杂,但是也是一种很简便的算法思想,所以在此做一下记录题目描述: 141. Linked List Cycle I Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? Subscr

2017-06-10 14:58:36 297

原创 leetCode刷题归纳-backtracking(79. Word Search)

题目描述 Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or

2017-06-10 14:41:28 222

原创 leetCode刷题归纳-backtracking(39. Combination Sum I && II)

题目描述:39. Combination Sum I Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.

2017-06-10 14:33:21 207

原创 leetCode刷题归纳-Dynamic Programming(85. Maximal Rectangle)

题目描述 Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area. For example, given the following matrix: 1 0 1 0 0 1

2017-06-10 14:08:52 195

原创 leetCode刷题归纳-Dynamic Programming(53. Maximum Subarray&& 152. Maximum Product 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

2017-06-10 13:54:28 223

原创 leetCode刷题归纳-Dynamic Programming(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 do

2017-06-10 13:46:55 179

原创 leetCode刷题归纳-Dynamic Programming(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 [

2017-06-10 13:16:03 197

原创 leetCode刷题归纳-Dynamic Programming( 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 respectiv

2017-06-10 13:06:49 235

原创 leetCode刷题归纳-Dynamic Programming(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

2017-06-10 12:59:50 190

原创 leetCode刷题归纳-Dynamic Programming(514. Freedom Trail)

题目描述 In the video game Fallout 4, the quest “Road to Freedom” requires players to reach a metal dial called the “Freedom Trail Ring”, and use the dial to spell a specific keyword in order to open the

2017-06-10 12:43:45 301

原创 贴吧爬虫

#-*-coding:utf8-*-from lxml import etreefrom multiprocessing.dummy import Pool as ThreadPoolimport requestsimport json#避免编码错误import sysreload(sys)sys.setdefaultencoding('utf-8')'''重新运行之前请删除cont

2017-06-08 14:46:36 296

原创 leetCode刷题归纳-Array(448. Find All Numbers Disappeared in an Array Add to List)

很有意思的思路,采用标记负值的方法解决,如果出现过就标记为负数,最后检测正数的位置,其索引值对应的就是没有出现过的位置。 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the

2017-05-07 18:42:06 182

原创 leetCode刷题归纳-Array(216. Combination Sum III)

这一题有点小复杂。。。。主要是递归算法的设计比较考验编程能力。。。没有时空间复杂度的要求,使用递归也比较方便理解,题目描述如下,大概就是使得k个1-9的数之和为n;代码贴到下面,好好理解: Example 1: Input: k = 3, n = 7 Output: [[1,2,4]] Example 2: Input: k

2017-04-30 20:01:46 154

原创 leetCode刷题归纳-Array(74. Search a 2D Matrix)

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first integer of

2017-04-23 20:32:09 159

原创 leetCode刷题归纳-List(25. Reverse Nodes in k-Group)

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to the length of the linked list. If the n

2017-04-23 20:28:03 186

原创 网易2017笔试题-日记的颜色

题目描述最近面试做了一个笔试题,感觉还挺有收获的。输入输出样例输入例子:2 <diary><color=red>I am happy.<color=blue>I am sad.</color>I am happy.</color>This is black.</diary> <diary><color=ab>12</color><color=a>12</color><color=aa>

2017-04-16 18:44:41 492

原创 leetCode刷题归纳-Divide and Conquer(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

2017-03-24 18:09:58 340

原创 leetCode刷题归纳-Divide and Conquer(312. Burst Balloons)

这个是比较久之前写的题了,今天刚好复习又看到。 虽然被归类到DC分类,但是比较明显的DP算法题(个人感觉),题目描述就不写了,直接上Example: Example: Given [3, 1, 5, 8] Return 167nums = [3,1,5,8] --> [3,5,8] --> [3,8] --> [8] --> [] coins = 3*1

2017-03-19 20:14:29 265

原创 leetCode刷题归纳-Divide and Conquer(241. Different Ways to Add Parentheses)

Divide的题目相比起来难度会比较大,主要是分治的思想比较难以与实际应用结合起来,下面是题目描述: Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and opera

2017-03-19 18:44:16 249

原创 leetCode刷题归纳-List(148 Sort List)

题目标题是148. Sort List中等难度,但是需要用到divide & conquer的思想,个人感觉还是比较有难度,题目描述如下: Sort a linked list in O(n log n) time using constant space complexity.要求时间复杂度为O(n log n)空间复杂度为O(1),分析可知,只能用分治的思想来完成才能达到要求,因为只有分治

2017-03-12 13:20:27 255 1

原创 leetCode刷题归纳-Array(Best Time to Buy and Sell Stock I&II&III)

最近因为准备面试,一直在leetcode上面刷题,在刷题的同时也会在有道云笔记上简单写一下个人体会,不足之处就是大部分的笔记都比较乱,没有系统的总结一些相似的题型和解法。正好林老师的算法课要求每周选择一个题目写一下解题心得,在这里也对之前做过的一些题目进行归纳整理,在巩固所学的同时也方便和大家分享讨论。Best Time to Buy and Sell Stock I&II&III选择的题目是股票买

2017-03-03 22:27:50 217

中山大学数据学院-数字图像处理平时作业和期末作业代码文档(matlab)

中山大学数据学院-数字图像处理平时作业和期末作业代码文档,朝老师的课,自己写的作业,很用心非常仔细,供大家参考借鉴

2017-12-01

中山大学数据学院密码学期末复习资料合集

期末复习整理的内容,整理不易~~赚点积分,整理的比较具体,考试如果开卷很有用~

2017-12-01

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除