
学习
那个字念颀
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python学习笔记 (string)
关于python的字符串Slice with [ start : end : step ] You can extract a substring (a part of a string) from a string by using a slice. You define a slice by using square brackets, a start offset, an end offse原创 2017-08-17 15:54:03 · 356 阅读 · 0 评论 -
关于《算法概论》中,使用dfs对图进行标记的操作的实践
其实本身是在做leetcode 685. Redundant Connection II 题目说一定以根节点开头,但实际好像并非如此…感觉被坑了。 原先的思路是利用书中所说的dfs,选好根节点,进行pre和post标记,根据每个节点的标记判断前向边,横跨边,回边。 不过测试会出现第一个边是需要删除的边的情况。。。就权当对bfs的边判断的练手了class Solution {pu原创 2018-01-05 20:42:00 · 467 阅读 · 0 评论 -
leetcode练习 Min Cost Climbing Stairs
再次进入动态规划的学习,先选了一道easy的题目,果然一次过。。。class Solution {public: int minCostClimbingStairs(vectorint>& cost) { vectorint> step; step.resize(cost.size()); for (int i = 0; i < cos原创 2018-01-05 21:48:57 · 230 阅读 · 0 评论 -
leetcode练习 Delete and Earn
Given an array nums of integers, you can perform operations on the array.In each operation, you pick any nums[i] and delete it to earn nums[i] points. After, you must delete every element equal to n原创 2018-01-07 22:02:13 · 386 阅读 · 0 评论 -
leetcode练习 Maximum Length of Repeated Subarray
Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.Example:Input:A: [1,2,3,2,1]B: [3,2,1,4,7]Output: 3Explanation: The repeated subarray wi原创 2018-01-09 21:04:28 · 242 阅读 · 0 评论 -
leetcode练习 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 adjacent house原创 2018-01-26 16:50:33 · 209 阅读 · 0 评论 -
leetcode练习 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.Determine if yo原创 2018-01-10 15:45:13 · 183 阅读 · 0 评论 -
关于一个NP完全问题的证明
这里给出的例子是教材《算法概论》P267的8.14。题目: Prove that the following problem is NP-complete: given an undirected graph G = (V, E) and an integer k, return a clique of size k as well as an independent set of size k原创 2018-01-20 12:04:44 · 527 阅读 · 0 评论 -
系统分析与设计作业1
1、简单题软件工程的定义: 软件工程一直以来都缺乏一个统一的定义,很多学者、组织机构都分别给出了自己认可的定义:BarryBoehm:运用现代科学技术知识来设计并构造计算机程序及为开发、运行和维护这些程序所必需的相关文件资料。IEEE:在软件工程术语汇编中的定义:软件工程是:1.将系统化的、严格约束的、可量化的方法应用于软件的开发、运行和维护,即将工程化应用于软件;2.在1中所述方法...原创 2018-03-14 22:55:59 · 327 阅读 · 0 评论 -
leetcode练习 Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. 题目说用一种方法表示图,属于题目自己的方便,跟代码没啥关系,就不放了,反正就是个克隆图。这次继续熟悉unordered_map 对应关系就是原图对应克隆图,代码如下:/** * Definiti...原创 2018-03-19 22:26:33 · 162 阅读 · 0 评论 -
系统分析与设计作业2
1.简答题简述瀑布模型、增量模型、螺旋模型(含原型方法)的优缺点。 瀑布模型的优点: 1、让开发人员采用规范的方法; 2、严格规定了每个阶段必须提交的文档; 3、要求每个阶段交出的所有产品都必须经过质量保证小组的仔细验证。 瀑布模型的缺点: 1、在软件开发初期,指明用户全部需求是困难的; 2、需求确定后,经过一段时间才得到软件最初版本; 3、完全依赖规格说明,导致不能...原创 2018-03-19 23:16:16 · 388 阅读 · 0 评论 -
系统分析与设计作业3
1、 用例建模a. 阅读 Asg_RH 文档,绘制用例图。 按 Task1 要求,请使用工具 UMLet,截图格式务必是 png 并控制尺寸 Task 1 Develop a detailed use case model for “Reserve Hotel”. The model should take a user’s (rather than system’s) perspec...原创 2018-04-15 23:11:47 · 344 阅读 · 0 评论 -
系统分析与设计4
1、 领域建模a. 阅读 Asg_RH 文档,按用例构建领域模型。领域模型:b. 数据库建模(E-R 模型)(1)系统的 E-R 模型(数据逻辑模型): (2)导出 Mysql 物理数据库的脚本:/*==============================================================*//* DBMS name: ...原创 2018-05-06 22:03:26 · 252 阅读 · 0 评论 -
系统分析与设计5
1)使用 UML State Model建模对象: 参考 Asg_RH 文档, 对 Reservation/Order 对象建模。 建模要求: 参考练习不能提供足够信息帮助你对订单对象建模,请参考现在 定旅馆 的旅游网站,尽可能分析围绕订单发生的各种情况,直到订单通过销售事件(柜台销售)结束订单。 2)研究淘宝退货流程活动图,对退货业务对象状态建模 ...原创 2018-05-06 22:07:04 · 254 阅读 · 0 评论 -
系统分析与设计lesson13
描述软件架构与框架之间的区别与联系 软件架构是一个系统的草图。软件架构描述的对象是直接构成系统的抽象组件。各个组件之间的连接则明确和相对细致地描述组件之间的通讯。软件框架是指在一定的设计原则基础上,从不同角度对组成系统的各部分进行搭配和安排,形成系统的多个结构而组成架构,它包括该系统的各个组件,组件的外部可见属性及组件之间的相互关系。组件的外部可见属性是指其他组件对该组件所做的假设。绘制三层...原创 2018-06-30 18:17:28 · 285 阅读 · 0 评论 -
leetcode练习 Reconstruct Itinerary
Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to a man who departs from JFK. Thus, the原创 2018-01-03 21:53:27 · 337 阅读 · 0 评论 -
leetcode练习 Evaluate Division
Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the answer do原创 2018-01-02 22:57:10 · 219 阅读 · 0 评论 -
leetcode练习 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 is the time it takes for a原创 2018-01-01 20:53:49 · 280 阅读 · 0 评论 -
leetcode试手 Reverse Integer
选了门算法分析与设计,老师推荐了leetcode网站作为编程的练习。第一次接触这个网站,感觉有点意思,再加上许久不打类似的题目有点生疏,选了个easy的题目试了试手,还是能找到自己的不足之处。Reverse Integer 一个很easy的题目,但是我用的方法好像非常的复杂…… 首先写了个int转string的函数void int2string(const int& num, string &s原创 2017-09-07 14:06:44 · 186 阅读 · 0 评论 -
leetcode练习 Beautiful Arrangement
第一节课没讲什么内容,主要就是斐波那契数列,因此想找一个递归相关的题目,但是递归内容的几道题全部都要氪金… 就找了个回溯的题目。。小试牛刀,选了中等难度的Beautiful Arrangement。题目: Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is c原创 2017-09-08 01:33:47 · 334 阅读 · 0 评论 -
leetcode学习 Merge Intervals
又是一道中等题目,本来想随便做做,结果遇到了一些小问题,写下来引以为戒。题目: Given a collection of intervals, merge all overlapping intervals.For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18].是个比较简单的题目根据题目要求,只需原创 2017-09-10 16:51:08 · 306 阅读 · 0 评论 -
关于对多项式的两种表示法的初步理解
上一节算法的核心是讲快速傅立叶变换。 基础当然是傅立叶变换。 但是我啥都不记得了。 emmm 老师姑且把傅立叶变换的原理讲了讲。 最基础也是最重要的便是对多项式两种表示法的理解。我自己对这部分内容有一个初步的理解,在这里做个记录,以备以后更正或者参考。首先一个正常的多项式 y = a0 + a1x1x^1 + a0x2x^2 + … + anxnx^n该表示法是使用系数a0, a1…,原创 2017-09-19 01:20:20 · 7198 阅读 · 1 评论 -
leetcode练习 Kth Largest Element in an Array
分治稍微讲了讲简单的第k大的数 就简单的在leetcode上面练练手 题目: 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, Give原创 2017-09-20 00:26:59 · 275 阅读 · 0 评论 -
leetcode练习 Reverse Pairs
几次练手之后,决定进军hard难度 最近的课程主要讲的是分治,就选择了相关的题目。Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j].You need to return the number of important reverse pairs in the原创 2017-09-12 00:01:25 · 270 阅读 · 0 评论 -
初识数字图像处理(一)
最先学习的是使用直方图均衡和直方图匹配算法处理图像直方图均衡算法输入一个灰度图像,直方图均衡算法就是寻找一个灰度值的变换函数。这个变换函数能让输入的灰度图像的直方图变得更加均衡,也就是对比度更大,图像质量更好。直方图又是什么呢,灰度直方图的横坐标是灰度值,纵坐标是该灰度级出现的概率。也就是一个pdf直方图均衡的算法中,利用同一小块灰度变化的过程中,像素个数相等的特性,列出公式∫DB+ΔDBDBHB(原创 2017-10-08 15:34:25 · 387 阅读 · 0 评论 -
DES密码的思想
web安全学了些密码系统,还讲了具体算法,emmm感觉还是比较感兴趣 目前主要讲了DES密码,貌似是一个不是特别优秀但是比较大众化的密码系统。 也是记录在这里,给以后的自己当个备忘录。 目前只写了伪代码,打算有空的时候真正实现一下。不过感觉很少有有空的时间呢hhhhh(其实是想把有空的时间留给算法)算法原理概述– 设信息空间由 {0, 1} 组成的字符串构成,明文信息和经过DES 加密的密文原创 2017-10-08 22:40:37 · 928 阅读 · 0 评论 -
leetcode练习 Task Scheduler
Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could be done without original order. Each task could be原创 2017-10-30 02:54:04 · 305 阅读 · 0 评论 -
leetcode练习 Course Schedul
最近一直是图论的学习,还是找一个图论的题目 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原创 2017-10-23 01:31:13 · 302 阅读 · 0 评论 -
leetcode练习 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 valu原创 2017-11-13 01:26:37 · 281 阅读 · 0 评论 -
leetcode练习 714. Best Time to Buy and Sell Stock with Transaction Fee
动态规划感觉很重要,很锻炼思维。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 may comp原创 2017-11-20 02:08:35 · 345 阅读 · 0 评论 -
leetcode练习 Course Schedule II
之前做了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 f原创 2017-11-06 01:56:24 · 177 阅读 · 0 评论 -
Erron错误对照表
} return 0; } 错误对照表: errno0 : Successerrno1 : Operation not permittederrno2 : No such file or directoryerrno3 : No such processerrno4 : Interrupted system callerrno5 : Inp转载 2017-12-17 13:41:56 · 4019 阅读 · 0 评论 -
系统分析与设计lesson16
使用 ECB 实现 make reservation 用例的详细设计(包含用例简介,顺序图,类图)用例简介:用户首先开始搜索酒店,然后根据搜索方式开始按照酒店名称搜索酒店,搜索完成之后得到搜索表单。根据搜索表单,用户选择满意的酒店,选择酒店完成后,用户再选择房间类型,并最后验证预订就完成了整个过程。顺序图: UML类图: 2.将逻辑设计类图映射到实际项目框架的包图。用树形结...原创 2018-06-30 18:42:57 · 236 阅读 · 0 评论