自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(39)
  • 问答 (4)
  • 收藏
  • 关注

原创 1099 Build A Binary Search Tree (30分)

题目:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less thanthe node’s key.The right subtree of a node contains only nodes with keys grea

2020-06-22 15:35:20 182

原创 PAT 1043 Is It a Binary Search Tree (25分)

题目:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less thanthe node’s key.The right subtree of a node contains only nodes with keys grea

2020-06-19 17:02:04 183

翻译 Traffic Monitor

Routine Examination of Network网络已经成为许多服务和业务的基础设施,因此保持正常稳定的运行是很有必要的。但是也免不了会有问题发生。当网络上发生错误时,必须找出原因并迅速恢复操作。不用说,为了检测错误和识别原因,有必要定期了解网络状态。例如,假设某一网络设备的某个端口的流量值非常高,如果没有连续测量该端口的流量,则无法确定该端口是处于异常状态还是通常处于异常状态,何...

2020-02-19 11:06:54 827

翻译 使用Ryu实现交换式集线器(Switching hub)

Switching hubSwitching hub,即交换式集线器,是一个能在共享网络拓扑结构中减少竞争的设备。假如你有一个由20个用户组成的网,因为信息传输量超载而停止运行,你可以将其分拆成两个段并桥接它们,这样就会减少整个系统的数据传输负载,并减少每一个新网络段上的竞争访问。位于同一网段上的所有用户或设备彼此之间能正常通信,只有这样才会减少段之间的通信量。如果通信量仍有问题,你还可以将L...

2020-02-17 12:08:22 1416 1

原创 PAT 1040 Longest Symmetric String (25分)

题目:Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest symmetric sub-string is s PAT&TAP s, hence ...

2020-02-06 12:58:15 96

原创 PAT 1039 Course List for Student (25分)

题目:Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who co...

2020-02-05 18:12:03 99

原创 PAT 1041 Be Unique (20分)

题目:Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,10​4​​]. The first one who be...

2020-02-04 19:09:27 74

原创 PAT 1037 Magic Coupon (25分)

题目:The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times the value of that produ...

2020-02-03 20:23:03 88

原创 PAT 1036 Boys vs Girls (25分)

题目:This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specification:Each input file contains one...

2020-02-03 16:49:27 68

原创 PAT 1035 Password (20分)

题目:To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l...

2020-02-03 16:14:07 65

原创 PAT 1032 Sharing (25分)

题目:To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For exam...

2020-01-30 18:31:42 133

原创 PAT 1031 Hello World for U (20分)

题目:Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll rlowoThat is, the characters must be prin...

2020-01-30 15:36:12 100

原创 PAT 1030 Travel Plan (30分)

题目:A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest pa...

2020-01-30 13:57:00 74

原创 PAT 1029 Median (25分)

题目:Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 12, and the median of S2 = { 9, 10, 15, 16, 17 ...

2020-01-29 15:27:28 99

原创 PAT 1028 List Sorting (25分)

题目:Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contains t...

2020-01-29 14:24:17 96

原创 PAT 1027 Colors in Mars (20分)

题目:People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2...

2020-01-29 12:24:52 119

原创 1025 PAT Ranking (25分)

题目:Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklis...

2020-01-28 17:52:07 91

原创 Exception: Error creating interface pair (s11-eth2,s12-eth2): RTNETLINK answers: File exists

在终端新建一个拓扑文件,然后执行时出现如下错误:原因是重复构建了相同的拓扑,我先前直接用命令行创建了一个拓扑结构,没有清除,所以若在.py文件中构建相同的拓扑图时需要先清除掉先前的拓扑结构。命令如下:sudo mn -c...

2020-01-21 22:22:40 4966

原创 PAT 1021 Deepest Root (25分)

题目:A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a r...

2020-01-20 17:34:07 101

原创 PAT 1020 Tree Traversals (25分)

题目:Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the...

2020-01-17 22:05:16 60

原创 PAT 1017 Queueing at Bank (25分)

题目:Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yello...

2020-01-16 20:50:29 107

原创 PAT 1015 Reversible Primes (20分)

题目:A reversible prime in any number system is a prime whose “reverse” in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also ...

2020-01-13 18:39:05 64

原创 PAT 1013 Battle Over Cities (25分)

题目:It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we...

2020-01-11 23:30:22 59

原创 PAT 1012 The Best Rank (25分)

题目:To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E -...

2020-01-11 17:53:00 78

原创 PAT 1010 Radix (25分)

题目:Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive i...

2020-01-10 11:17:12 117

原创 PAT 1009 Product of Polynomials (25分)

题目:This time, you are supposed to find A×B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the infor...

2020-01-09 10:42:52 94

原创 PAT 1007 Maximum Subsequence Sum (25分)

题目:Given a sequence of K integers { N​1​​, N​2​​, …, N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​, …, N​j​​ } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequen...

2020-01-07 18:20:47 53

原创 PAT 1006 Sign In and Sign Out (25分)

题目:At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in’s and out’s,...

2020-01-07 12:03:39 61

原创 PAT 1005 Spell It Right (20分)

题目:Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. E...

2020-01-06 19:39:33 73

原创 PAT 1003 Emergency (25分)

题目:As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and t...

2020-01-06 18:13:16 107

原创 1002 A+B for Polynomials (25分)

题目:This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the infor...

2020-01-05 16:18:29 92

原创 PAT 1001 A+B Format (20分)

题目:Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input...

2020-01-04 21:15:15 54

原创 LeetCode:1305. 两棵二叉搜索树中的所有元素

题目描述:给你 root1 和 root2 这两棵二叉搜索树。请你返回一个列表,其中包含 两棵树 中的所有整数并按 升序 排序。.示例 1:输入:root1 = [2,1,4], root2 = [1,0,3]输出:[0,1,1,2,3,4]示例 2:输入:root1 = [0,-10,10], root2 = [5,1,7,0,2]输出:[-10,0,0,1,2,5,7,10]...

2020-01-03 22:14:39 159

原创 直方图均衡化原理及计算

直方图均衡化是基于灰度直方图的图像增强的一种方法,还有另外一种方法是直方图规定化。均衡化的目的是将原始图像的直方图变为均衡分布的的形式,将一非均匀灰度概率密度分布图像,通过寻求某种灰度变换,变成一幅具有均匀概率密度分布的目的图像。具体原理如下:1、连续灰度级:假定:r代表灰度级,P(r)为概率密度函数。r值已经过归一化处理,灰度值范围在[0,1]之间。r与P(r)之间的关系如下:...

2019-11-24 21:45:10 27042 6

原创 文件描述符

所有对设备和文件的操作都使用文件描述符进行。文件描述符是内核为了高效管理已被打开的文件所创建的索引值,即利用文件描述符来访问文件,值为非负整数,通常为小整数,用于指代被打开的文件。当程序打开一个现有文件或创建一个新文件时,内核向进程返回一个文件描述符。通常情况下,一个进程启动时,都会打开三个文件,即标准输入、标准输出、标准错误。标准输入的文件描述符是0,标准输出是1,标准错误是2。所以若此...

2019-11-19 13:27:34 168

原创 Ubuntu使用useradd和adduser新建用户

1、创建自己的账户和口令以root管理员用户身份进行操作,root是linux系统中权限最高的用户。“whoami”–显示当前用户“sudo su”–切换到root用户可以使用useradd和adduser命令新创建用户账号和口令...

2019-11-02 22:34:46 1006

原创 Anaconda3安装dlib库

这两天要用到dlib库,于是就想直接在pyCharm直接安装,却发生了报错,安装不了。也不能直接用pip install dlib安装,也会发生报错,于是就在网上查阅各种教程,什么cmake,boost都安装了,环境变量也配了,但还是出现了许多问题,总之就是走一步就踩十个坑。最后在经历了各种折腾之后终于通过简单几步就安装成功了,顺便在这里记录下安装成功的过程。下载dlib的安装包 下载地...

2019-10-06 14:44:16 2910 2

原创 FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version

FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource",...

2019-09-04 11:03:49 1046

原创 matplotlib.pyplot的用法

matplotlib.pyplot的用法由于最近在学深度学习,而在做神经网络训练时少不了要绘制图,因此需要经常接触到matplotlib.pyplot,所以这篇文章想记录下关于matplotlib.pyplot的一些用法,也算是加深自己对matplotlib.pyplot的理解吧。关于matplotlib.pyplotmatplotlib.pyplot是一组命令样式函数,能够使matplot...

2019-09-03 21:06:44 513

空空如也

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

TA关注的人

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