01 2020 档案
摘要: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 c
阅读全文
摘要:To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mat
阅读全文
摘要: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 ro
阅读全文
摘要:最短路径 1.概念 单源最短路径 单源最短路径实际是计算源点到其他各个顶点的最短路径的长度,常见算法有dijkstra算法 全局最短路径 全局最短路径实际是计算每个源点到其他各个顶点的最短路径的长度,我们可以调用dijkstra算法N次(这样没有Floyd算法快),常见解决全局最短路径的方法是Flo
阅读全文
摘要:People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, m
阅读全文
摘要:Given two sets of integers, the similarity of the sets is defined to be /, where Nc is the number of distinct common numbers shared by the two sets
阅读全文
摘要:Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color
阅读全文
摘要:Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output t
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one test
阅读全文
摘要: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
阅读全文
摘要: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, wher
阅读全文
摘要:KMP算法 在字符串匹配中,我们一般是BF算法,暴力破解。当然上完数据结构课之后,我们知道可以通过KMP进行优化。 上数据结构这门课的时候,我没有好好听KMP,本篇文章参考程杰老师的《大话数据结构》中KMP算法一章节记录的笔记,可以的话请阅读原书中该章节,这里相当于原书的复述。 这边引用书中的一句话
阅读全文
摘要:Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we c
阅读全文
摘要:XCode + IOS + Flutter真机调试 报错: Could not build the precompiled application for the device. It appears that your application still contains the default
阅读全文
摘要:Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 1673
阅读全文
摘要:Consider a positive integer N written in standard notation with k+1 digits ai as ak⋯a1a0 with 0 for all i and ak>0. Then N is palindrom
阅读全文
摘要:Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains
阅读全文
摘要: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 numbe
阅读全文
摘要:Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run sim
阅读全文
摘要:A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years
阅读全文
摘要:A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number
阅读全文
摘要:With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing ba
阅读全文
摘要:The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of b
阅读全文
摘要:Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, a
阅读全文
摘要:On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on sc
阅读全文
摘要:People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzi
阅读全文
摘要:Servlet复习 1.Servlet执行原理 1.tomcat接受客户端的请求,去web.xml解析URL路径,访问Servlet的资源路径 2.根据资源路径,和servlet name,找到servlet class 3.tomcat将全类名对应字节码加载进内存 Class.forName()
阅读全文
摘要:There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then th
阅读全文
摘要: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
阅读全文
摘要:Http协议 1.介绍 HTTP:超文本传输协议 作用:规范浏览器与服务器的交互 特点: 简单快速 灵活 无连接(HTTP 1.1版本后支持可持续性连接 无状态 支持B/S和C/S架构 2.交互流程 建立连接 3次握手,Client发送Syn标志位置,Server回应Ack+Syn,Client在此
阅读全文
摘要:Given any string of N (≥) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l l r
阅读全文
摘要:自然码双拼快速记忆方案 1.zh ch sh zh——v像树枝 ch——i像尺子 sh——u像试管 举例: uu vi——树枝 ii zi——尺子 ui gr——试管 2.三个故事记住双拼 故事1: 分行追贼来求警,靠您 ff hh vv zz ll qq jj kk nn fen hang zhu
阅读全文
摘要:只需在终端内输入以下命令即可: defaults write com.apple.inputmethod.CoreChineseEngineFramework shuangpinLayout 5 系统为macOS Catalina 10.15.2 参考博客:https://www.dazhuanla
阅读全文
摘要:An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the
阅读全文
摘要:Given two strings S1 and S2, S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task
阅读全文
摘要:Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 2469135
阅读全文
摘要: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 symme
阅读全文
摘要:动态规划 参考视频av16544031、av18512769 一、重叠子问题 问题 1 回顾斐波那契数列,实质是一个递归关系 也是一个overlap sub problem 重叠子问题 如果我们要计算fib(7),就会去计算fib(6)和fib(5),之后继续往下,中间fib(6)分解成fib(5)
阅读全文
摘要:1020 Tree Traversals (25分) Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequen
阅读全文
摘要:A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specification: Each inp
阅读全文
摘要:在我们业务开发中,常用到密码校验的特殊符号。那么,什么字符属于特殊符号呢? 以下列出特殊符号集合 ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
阅读全文
摘要:In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is supe
阅读全文
摘要:The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed
阅读全文
摘要:Given three integers A, B and C in [−], you are supposed to tell whether A+B>C. Input Specification: The first line of the input gives the positive nu
阅读全文
摘要: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 occu
阅读全文
摘要:The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elev
阅读全文
摘要: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
阅读全文
摘要: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 occu
阅读全文
摘要:回顾 一元线性回归 Python实现my_sgd Scala调用n元线性回归 linearRegression02.scala linearRegression03.scala sample_linear_regression_data.txt
阅读全文
摘要:In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the
阅读全文
摘要:In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the
阅读全文
摘要:``` typedef struct HNode *Heap; /* 堆的类型定义 */ struct HNode { ElementType *Data; /* 存储元素的数组 */ int Size; /* 堆中当前元素个数 */ int Capacity; /* 堆的最大容量 */ }; typedef Heap MaxHeap; /* 最大堆 */ typedef Heap MinHeap
阅读全文
摘要:express 是一个js的web框架,对http库进行了二次封装。下面是一段精简简要解读,带注释。 依赖npm外部库:express、body parser、multer body parser是一个进行解析request的body段区域的js库 multer是一个进行解析文件upload的库 使
阅读全文
摘要:node 1.常用全局对象 2.模块导出的三种方式 js var counter = function(arr){ return "threre are " + arr.length + " elements in the array" } var adder = function(a,b){ re
阅读全文
摘要:现在是2020年1月4日早上4点34分,刷课刷到1点,之后刷知乎到现在。 思考自己未来想从事什么行业,一直都是一个比较困惑的事情,不同的人有不同的答案。 今天4:36分,过去一个月在准备期末考,期末考完说是休息,但自己却闲不下来。自己明白,互联网行业,追求什么,想追求什么,选择什么方向,这段时间做什
阅读全文