02 2020 档案

摘要:conda install nomkl 阅读全文
posted @ 2020-02-26 06:03 SteveYu 阅读(176) 评论(0) 推荐(0)
摘要:魔鬼PAT训练 DAY3 4.4.贪心 B1023. 组个最小数(20') A1067.Sort with Swap(0, i) (25') B1040/A1093. 有几个PAT A1008.Elevator(0') A1049.Counting Ones(30') 阅读全文
posted @ 2020-02-24 20:43 SteveYu 阅读(221) 评论(0) 推荐(1)
摘要:魔鬼PAT训练DAY2 3.6. 字符串处理 B1006.换个格式输出整数(15') A1012.The Best Rank(25') B1039/A1092.到底买不买 阅读全文
posted @ 2020-02-23 22:25 SteveYu 阅读(303) 评论(0) 推荐(1)
摘要:Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to si 阅读全文
posted @ 2020-02-23 17:35 SteveYu 阅读(183) 评论(0) 推荐(0)
摘要:魔鬼PAT训练 DAY1 3.1.简单模拟 B1001.害死人不偿命的(3n+1)猜想 (15') B1011.A+B和C (15') B1016.部分A+B (15') B1046.划拳 (15') B1008.数组元素循环右移问题 (20') B1018.锤子剪刀布 (20') 1065.A+B 阅读全文
posted @ 2020-02-22 14:40 SteveYu 阅读(320) 评论(0) 推荐(0)
摘要:Zookeepe负责服务的注册,Dubbo负责服务之间的通讯 主要步骤: 0.新建一个空项目 1.新建一个SpringBoot模块,导入SpringWeb依赖 2.导入以下依赖,因为Dubbo没有固定的生态,所以只能自己写,或者使用第三方库,dubbo需要依赖curator等包,而zkClient是 阅读全文
posted @ 2020-02-20 15:14 SteveYu 阅读(343) 评论(0) 推荐(0)
摘要:微服务架构问题 四个核心问题 1.服务如何去访问? 2.服务如何进行通信? 3.服务如何治理? 4.服务挂了怎么办? 在Java生态上,构建是基于SpringBoot,协调是基于SpringCloud, 以下所有架构,全部基于以上4个问题进行解决 1.netflix 一站式解决方案 1.Api网关, 阅读全文
posted @ 2020-02-20 14:39 SteveYu 阅读(208) 评论(0) 推荐(0)
摘要:Makefile之清晰认知 关于Makefile,之前我在初学makefile依旧没有清晰认知。所以这次,我将着重探究一下Makefile文件的编写。 0.Makefile是什么 Makefile可以理解为一个脚本的执行器,也可以理解为一种简单语言 很多人觉得很神奇,包括我也是,第一次接触makef 阅读全文
posted @ 2020-02-18 12:21 SteveYu 阅读(189) 评论(0) 推荐(0)
摘要:实体类定义规则 在小型软件中,一般使用Entity表示实体层,实际上,实体层分为多种。 PO(persistent object) 持久层对象 VO(view object) 表现层对象 DTO(Data Transfer Object) 传输层对象 POJO(Plan ordinary Java 阅读全文
posted @ 2020-02-16 18:48 SteveYu 阅读(854) 评论(0) 推荐(0)
摘要:在云计算服务中,分为Saas、Paas、Iaas服务。 IaaS(Infrastructure-as-a-Service) 设施即服务。仅提供硬件平台,不提供操作系统和软件 Paas(Platform-as-a-Service) 平台即服务,提供硬件+操作系统平台。 Saas(Software-as 阅读全文
posted @ 2020-02-16 18:45 SteveYu 阅读(312) 评论(0) 推荐(0)
摘要:网页:包含一个CDN和一个post <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0" 阅读全文
posted @ 2020-02-16 18:00 SteveYu 阅读(609) 评论(0) 推荐(0)
摘要:本章节根据狂神的多线程视频进行整理,狂神多线程 av54171171 1.线程的概念 概念: 线程是操作系统能够进行运算调度的最小单位。 2.Java实现线程的3种方式 继承Thread类、实现Runnable接口、实现Callable接口 Callable不常用,容易忘记。所以重新写一遍 线程安全 阅读全文
posted @ 2020-02-15 06:39 SteveYu 阅读(188) 评论(0) 推荐(0)
摘要:js <script type="text/javascript"> window.cnblogsConfig = { GhVersions : 'v1.2.3', // 版本 blogUser : "Steve Yu's blog", // 用户名 homeBannerText: "喜欢阳光、午后 阅读全文
posted @ 2020-02-08 16:30 SteveYu 阅读(1205) 评论(7) 推荐(4)
摘要:用一个right记录正确与否,long int保存最小值,进行一轮中序遍历,每次比较pre和当前值,如果小于当前值,更新pre,否则,将right置为错误即可 /** * Definition for a binary tree node. * struct TreeNode { * int val 阅读全文
posted @ 2020-02-08 09:51 SteveYu 阅读(182) 评论(0) 推荐(1)
摘要:这题考察找树的坡度,我们直接返回左节点减右节点的绝对值加左节点的坡度加右节点的坡度。 getSum是找节点和,调用左节点的和加右节点的和加上本节点的值 /** * Definition for a binary tree node. * struct TreeNode { * int val; * 阅读全文
posted @ 2020-02-07 20:09 SteveYu 阅读(131) 评论(0) 推荐(0)
摘要:c++,如果本节点为空,返回0,否则返回 这棵树孩子中(找到每个节点的最大值,返回最大值+1即可,1是本节点的深度) /* // Definition for a Node. class Node { public: int val; vector<Node*> children; Node() { 阅读全文
posted @ 2020-02-07 19:41 SteveYu 阅读(135) 评论(0) 推荐(0)
摘要:开始耍小聪明啦,getMax是求得深度最大值。我们在diameterOfbinaryTree中不断求得左右子树的直径,相加,并且递归,即可获得最大值 /** * Definition for a binary tree node. * struct TreeNode { * int val; * T 阅读全文
posted @ 2020-02-07 19:34 SteveYu 阅读(147) 评论(0) 推荐(0)
摘要:要进行转这棵树,仅仅需要进行先遍历右子树,遍历中树,遍历左子树,然后加中间就ok /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; 阅读全文
posted @ 2020-02-07 19:19 SteveYu 阅读(101) 评论(0) 推荐(0)
摘要:教科书式编程:考察BST树中序有序。所以,我们仅仅需要对其中序记住前面一个节点,然后进行比较即可。最后更新ans /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * T 阅读全文
posted @ 2020-02-07 18:26 SteveYu 阅读(122) 评论(0) 推荐(0)
摘要:这道题考察计算众数,我们先对每个数字进行一轮计数,放在m中,然后遍历m,将熟知一样的众数追加到m2的vector中,最后把m2的最后指针所指向的vector返回即可 /** * Definition for a binary tree node. * struct TreeNode { * int 阅读全文
posted @ 2020-02-07 06:40 SteveYu 阅读(128) 评论(0) 推荐(0)
摘要:通过cnt进行计数,然后进行递归找。在递归的过程中,只要sum为0,则cnt加一 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; 阅读全文
posted @ 2020-02-07 06:26 SteveYu 阅读(131) 评论(0) 推荐(0)
摘要:要实现得到左叶子节点的和,我们加一个bool leftLeaf,代表左叶子,递归的时候,加上这个属性,就可以求得和 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * 阅读全文
posted @ 2020-02-07 06:15 SteveYu 阅读(90) 评论(0) 推荐(0)
摘要:cpp代码,easy的,寻找路径,只需要传递string,然后在叶子节点进行加入vector即可。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode 阅读全文
posted @ 2020-02-07 06:05 SteveYu 阅读(123) 评论(0) 推荐(0)
摘要:lca算法思路总结: 思想:二叉查找树的性质,如果是祖先,和左右子树的差值乘积为负数。 如果在左边,往左边进行递归。如果往右边,往右边递归。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeN 阅读全文
posted @ 2020-02-07 05:49 SteveYu 阅读(171) 评论(0) 推荐(0)
摘要:仅需要交换左右节点,然后进行递归翻转即可(太基础了) /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int 阅读全文
posted @ 2020-02-07 05:26 SteveYu 阅读(112) 评论(0) 推荐(0)
摘要:求路径和,仅需要一直减去当前节点的数字,然后看看在根结点的时候是否为0,如果不是返回false就行啦 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNod 阅读全文
posted @ 2020-02-07 05:19 SteveYu 阅读(100) 评论(0) 推荐(0)
摘要:我们要想知道最小深度,我们只需要知道根结点在的层级吖。这样思考是不是很方便。把每个根结点的层级加入map,取map的第一位,就是最小深度啦 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNo 阅读全文
posted @ 2020-02-07 04:58 SteveYu 阅读(110) 评论(0) 推荐(0)
摘要:判断平衡树的经典教科书办法:左右紫薯差小于等于1。 我们仅仅需要进行判断平衡,左右子树差小于等于1,继续返回左子树平衡且右子树平衡。 否则返回false /** * Definition for a binary tree node. * struct TreeNode { * int val; * 阅读全文
posted @ 2020-02-07 04:32 SteveYu 阅读(133) 评论(0) 推荐(0)
摘要:顺序数组建树,要从中间开始建树。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val( 阅读全文
posted @ 2020-02-07 03:58 SteveYu 阅读(135) 评论(0) 推荐(0)
摘要:中序遍历,常规操作 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), lef 阅读全文
posted @ 2020-02-07 03:33 SteveYu 阅读(98) 评论(0) 推荐(0)
摘要:c++比Binary Tree Level Order Traversal 多了一行reverse函数 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNo 阅读全文
posted @ 2020-02-07 03:22 SteveYu 阅读(128) 评论(0) 推荐(0)
摘要:二叉树的层序遍历,直接进行用二维vector进行层序,用一个queue进行,记录大小后,进行不断push进去。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * Tr 阅读全文
posted @ 2020-02-07 03:12 SteveYu 阅读(122) 评论(0) 推荐(0)
摘要:求树的最大深度,如果树为空,则返回0否则返回左最大深度和右最大深度的最大值,进行加一 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right 阅读全文
posted @ 2020-02-07 02:43 SteveYu 阅读(127) 评论(0) 推荐(0)
摘要:Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident 阅读全文
posted @ 2020-02-07 02:37 SteveYu 阅读(125) 评论(0) 推荐(0)
摘要:Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident 阅读全文
posted @ 2020-02-07 02:13 SteveYu 阅读(118) 评论(0) 推荐(0)
摘要:1.一元线性回归与损失函数 在我们解决一元线性回归进行拟合曲线的时候,常常会使用梯度下降法。 假设我们的数据集为 我们想将其拟合成一条曲线,然后进行训练。拟合曲线表示如下 我们如何去拟合呢?显然两点确定一条直线的。我们就其次,然后求得一个函数,各个点到该函数的方差和最小,于是,我们将其称为损失函数( 阅读全文
posted @ 2020-02-07 01:11 SteveYu 阅读(1562) 评论(0) 推荐(0)
摘要:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol ValueI 1V 5X 10L 50C 100D 500M 1000For example, two is writt 阅读全文
posted @ 2020-02-06 19:36 SteveYu 阅读(101) 评论(0) 推荐(0)
摘要:Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121Output: true 阅读全文
posted @ 2020-02-06 18:58 SteveYu 阅读(105) 评论(0) 推荐(0)
摘要:Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123Output: 321Example 2: Input: -123Output: -321Example 3: Input: 120Ou 阅读全文
posted @ 2020-02-06 18:42 SteveYu 阅读(88) 评论(0) 推荐(0)
摘要:Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minut 阅读全文
posted @ 2020-02-06 16:59 SteveYu 阅读(187) 评论(0) 推荐(0)
摘要:Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p​1​​​k​1​​​​×p​2​​​k​2​​​​×⋯×p​m​​​ 阅读全文
posted @ 2020-02-06 16:07 SteveYu 阅读(218) 评论(0) 推荐(0)
摘要:The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. 阅读全文
posted @ 2020-02-06 14:48 SteveYu 阅读(164) 评论(0) 推荐(0)
摘要:Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation tha 阅读全文
posted @ 2020-02-06 14:15 SteveYu 阅读(139) 评论(0) 推荐(0)
摘要:Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which cou 阅读全文
posted @ 2020-02-06 13:26 SteveYu 阅读(161) 评论(0) 推荐(0)
摘要:If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0 with simple c 阅读全文
posted @ 2020-02-05 17:39 SteveYu 阅读(207) 评论(0) 推荐(0)
摘要:For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient. Input Sp 阅读全文
posted @ 2020-02-05 16:54 SteveYu 阅读(179) 评论(0) 推荐(0)
摘要: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 s 阅读全文
posted @ 2020-02-05 14:36 SteveYu 阅读(168) 评论(0) 推荐(0)
摘要:1.网络模型 a.编程模型 TCP UDP TCP 可靠连接、使命必达、速度慢 UDP 不可靠、速度快 1.常见的IO模型 blocking IO == Old IO(BIO) 案例:如果不开线程,那么就会阻塞。 Non Blocking IO(NIO) Java的API还不如C 调用Linux底层 阅读全文
posted @ 2020-02-04 23:51 SteveYu 阅读(403) 评论(0) 推荐(0)
摘要: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 re 阅读全文
posted @ 2020-02-04 16:12 SteveYu 阅读(189) 评论(0) 推荐(0)
摘要:删除本地tag git tag -d v20190514 删除远程tag git push origin :refs/tags/v1.0 阅读全文
posted @ 2020-02-04 05:23 SteveYu 阅读(320) 评论(0) 推荐(1)
摘要:Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional 阅读全文
posted @ 2020-02-02 14:11 SteveYu 阅读(152) 评论(0) 推荐(0)
摘要:For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decre 阅读全文
posted @ 2020-02-02 13:11 SteveYu 阅读(167) 评论(0) 推荐(0)
摘要:A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find t 阅读全文
posted @ 2020-02-01 19:32 SteveYu 阅读(147) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-02-01 17:57 SteveYu 阅读(165) 评论(0) 推荐(0)
摘要:Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are fri 阅读全文
posted @ 2020-02-01 16:50 SteveYu 阅读(135) 评论(0) 推荐(0)
摘要:Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each va 阅读全文
posted @ 2020-02-01 16:34 SteveYu 阅读(143) 评论(0) 推荐(0)
摘要: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 1 阅读全文
posted @ 2020-02-01 15:25 SteveYu 阅读(134) 评论(0) 推荐(0)
摘要:The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s 阅读全文
posted @ 2020-02-01 01:27 SteveYu 阅读(182) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-02-01 01:11 SteveYu 阅读(212) 评论(0) 推荐(0)
摘要:Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input Specification: Each input file contains one 阅读全文
posted @ 2020-02-01 00:40 SteveYu 阅读(172) 评论(0) 推荐(0)