- 博客(24)
- 收藏
- 关注
原创 算法概论习题
8.3 证明吝啬SAT问题是NP-完全问题。首先已知SAT问题是NP-完全问题,因此只要找到一个由SAT问题到吝啬SAT问题的规约就可以证明吝啬SAT问题也是完全-NP问题。对于任何一个给定包含n个变量的SAT的实例I(n),对于I中的任何子句(,采用子句集()代替,其有效性证明与SAT问题到3SAT问题的规约类似,可以在多项式时间内完成。在进行拆分后,每个子句都包含最多2-3个变量,将其分割为吝啬
2018-01-13 22:24:03
260
原创 [leetcode]714. Best Time to Buy and Sell Stock with Transaction Fee
dynamic programming题目:Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee representing a transaction fee.You ma
2017-11-22 15:01:27
196
原创 [leetcode]435. Non-overlapping Intervals
greedy题目:Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note: You may assume the interval’s end point is alw
2017-11-21 22:34:12
204
原创 [LeetCode] 617. Merge Two Binary Tree
题目:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree
2017-11-20 16:24:45
232
原创 [leetcode]452. Minimum Number of Arrows to Burst Balloons
greedy题目:There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it’s horizontal, y
2017-11-08 17:42:59
272
原创 [leetcode]392. Is Subsequence
题目:Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is potentially a very long (length ~= 500,000) strin
2017-11-08 16:54:40
161
原创 [leetcode]455. Assign Cookies
greedy题目: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
2017-11-08 16:33:46
174
原创 [leetcode]122. Best Time to Buy and Sell Stock II
greedy题目: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 the s
2017-11-08 16:14:05
210
原创 [leetcode]651. 4 Keys Keyboard
dynamic programming题目:Imagine you have a special keyboard with the following keys: Key 1: (A): Prints one ‘A’ on screen. Key 2: (Ctrl-A): Select the whole screen. Key 3: (Ctrl-C): Copy selection to
2017-11-07 23:39:59
532
原创 [leetcode]484.Find Permutation
greedy题目:By now, you are given a secret signature consisting of character ‘D’ and ‘I’. ‘D’ represents a decreasing relationship between two numbers, ‘I’ represents an increasing relationship between tw
2017-11-07 16:22:28
611
原创 [leetcode]406. Queue Reconstruction by Height
greedy题目: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 the number of people in front
2017-11-07 12:19:07
160
原创 [leetcode]215. Kth Largest Element in an Array
divide and conquer题目: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
2017-11-05 22:51:46
186
原创 [leetcode]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,1] has
2017-11-05 18:14:55
178
原创 [leetcode]312. Burst Balloons
题目: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 you will get nums[
2017-11-05 17:32:37
194
原创 [leetcode]241. Different Ways to Add Parentheses
题目描述:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.Example 1 In
2017-11-04 18:11:52
181
原创 [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 element
2017-11-04 17:18:51
240
原创 框架学习boostrap MVC beego django laravel
Goal1、学习Python php 2、了解boostrap MVC beego django laravelWhat I getMVCMVC是一种框架,全称Model-View-Controller 1. Model(模型)——应用程序的处理:应用程序的核心,用来处理应用程序数据逻辑。 模型对象通常用来存取数据库数据。模型表示企业数据和业务规则。在MVC的三个部件中,模型拥有最多的处理
2017-08-09 16:21:52
3226
原创 记录week1
Goal1、实现文件进行增删查改的操作。 2、vaspView页面的优化。 3、vaspFile页面的优化。 4、将导航栏作为模板,引入页面,减少代码量。What I Get1、导航栏作为模板,引入页面之前的一些尝试AngularJs的ng-include <div ng-include="'myFile.html'"></div> ng-include 指令用于包含外部的 HTML
2017-08-09 16:05:16
237
原创 记录week2
What I Get1、文件列表1)改变文件列表的样式 File Id File Name Operation 1 example1 (view) (delete) 2 example2 (view) (delete) 3 example3 (view) (delete)变为:去掉表头 2)功能 delete:删除在服务器上的对应的文件 edit
2017-08-09 15:59:54
204
原创 记录week3
What I Get1、Delete具体实现1)利用post传参数给后台:创建虚拟表单form,不显示,定义method为“post”;增加元素并且将文件名作为value的值;然后提交。 2)删除文件这个操作有风险,需要再次确认是否要删除改文件:利用boostrap模态框实现。 3)进度:完成delete_a.onclick = function DeleteFileAlert() {
2017-08-09 15:50:45
271
原创 记录week4
Goal1、VaspSubmit需要实现版本选择器、核数选择器(可自定义、可选择) 2、传入到后台的数据包括软件版本、节点数、作业名(可以默认定义)、提交日期(服务器时间?)、用户名(默认定义)、作业状态(默认为1)、作业ID(按阿拉伯数字自增,如果前端不能保证原子操作,可以在后端实现)
2017-08-09 15:38:52
250
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅