common

235. Lowest Common Ancestor of a Binary Search Tree

﹥>﹥吖頭↗ 提交于 2019-11-29 03:46:26
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia : “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).” Given binary search tree: root = [6,2,8,0,4,7,9,null,null,3,5] Example 1: Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 8 Output: 6 Explanation: The LCA of nodes 2 and 8 is 6. Example 2: Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 4 Output: 2

webpack知识分享

冷暖自知 提交于 2019-11-28 22:36:52
webpack 4 webpack 四大核心概念: 入口(entry) // 打包入口 输出(output) : 打包后输出的位置配置 loader : loader 让 webpack 能够去处理那些非 JavaScript 文件(webpack 自身只理解 JavaScript)。loader 可以将所有类型的文件转换为 webpack 能够处理的有效模块 插件(plugins) : 有更强大的功能,比如:打包优化,压缩、代码分割、静态资源处理、环境变量的注入、将所有css的module抽取为单个文件等 1.入口 配置 entry 属性,来指定一个入口起点(单页面)(或多个入口起点(多页面))。默认值为 ./src //单页面入口 entry: { main: './path/to/my/entry/file.js' } //单页面入口简写 chunk名默认为main entry: './src/main.js', //多页面入口 entry: { pageOne: './src/pageOne/index.js', pageTwo: './src/pageTwo/index.js', pageThree: './src/pageThree/index.js' } webpack4 打包应用过程中的提取公共代码部分。相比于 webpack3 , 4.0 版本用

C. Common Divisors (Codeforces Round #579 )

拟墨画扇 提交于 2019-11-28 16:44:57
You are given an array a a consisting of n n integers. Your task is to say the number of such positive integers x x such that x x divides each number from the array. In other words, you have to find the number of common divisors of all elements in the array. For example, if the array a a will be [ 2 , 4 , 6 , 2 , 10 ] [2,4,6,2,10], then 1 1 and 2 2 divide each number from the array (so the answer for this test is 2 2). Input The first line of the input contains one integer n n ( 1 ≤ n ≤ 4 ⋅ 10 5 1≤n≤4⋅105) — the number of elements in a a. The second line of the input contains n n integers a 1

linux搭建samba服务器

六眼飞鱼酱① 提交于 2019-11-28 09:55:31
搭建的环境:linux7.0 samba 跨平台的文件共享 Samba服务 主要作用:进行文件共享 协议:SMB (TCP 139) CIFS( TCP 445) 所需软件包:samba 系统服务:smb systemctl restart smb 搭建步骤: 1、yum -y install samba 2、创建samba的共享账号,(客户端访问服务端共享文件验证用的) samba的共享账号和本地用户关系:samba的共享账号和本地系统用户账号相同密码不同,系统密码用来登陆系统,samba密码用来识别共享文件夹 useradd -s /sbin/nologin harry ----------创建的用户harry不能登陆系统 useradd -s /sbin/nologin kenji useradd -s /sbin/nologin chihiro 创建的这些用户不需要设置密码,因为不需要他们登陆操作系统,这些用户是用来作为samba共享文件验证用户用的 添加创建的系统用户为samba验证用户 添加用户:pdbedit -a 用户名 查询用户:pdbedit -L 用户名 删除用户:pdbedit -x 用户名 pdbedit -a harry 回车后输入要设置的验证密码(添加samba账号,设置密码) 3、修改服务主配置文件:/etc/samba/smb.conf

[LeetCode] 1123. Lowest Common Ancestor of Deepest Leaves 最深叶结点的最小公共父节点

非 Y 不嫁゛ 提交于 2019-11-28 06:27:17
Given a rooted binary tree, return the lowest common ancestor of its deepest leaves. Recall that: The node of a binary tree is a leaf if and only if it has no children The depth of the root of the tree is 0, and if the depth of a node is d , the depth of each of its children is d+1 . The lowest common ancestor of a set S of nodes is the node A with the largest depth such that every node in S is in the subtree with root A . Example 1: Input: root = [1,2,3] Output: [1,2,3] Explanation: The deepest leaves are the nodes with values 2 and 3. The lowest common ancestor of these leaves is the node

ThinkPHP - 目录介绍

萝らか妹 提交于 2019-11-28 00:01:08
ThinkPHP框架 特点: 免费开源 敏捷开发(快速开发) 面向对象 MVC思想 yii,ci之类的框架都有这些特点.是06年到现在的一个老牌框架,现在还是个很不错的框架 Application:应用程序目录 Public:静态资源目录 ThinkPHP:tp框架本身 Common:公共文件目录 Conf:配置文件 Lang:语言包 Library:系统核心基内库 Tpl:系统模版目录 index.php:项目的单一入口 直接在环境下用浏览器打开如:localhost/shopp 进入即可看到一张笑脸 她会自动在Application这个目录下生存Home目录和Runtime目录以及Common目录 在Home目录下可看到以下目录 Common:公共文件的目录,如自己编写的函数之类的 Conf:home模块配置目录 Controller:控制器目录 Model:数据库模型目录 View:视图目录 来源: http://www.cnblogs.com/ggkxg/p/5768826.html

本地项目,发布至服务器

时光毁灭记忆、已成空白 提交于 2019-11-27 23:59:59
1.将项目打包(jar war)  右键点击项目,选择Export 按照需要导出相应的包(jar war) 2.将压缩包拖动至winscp工具相对应的文件夹中,通过putty工具解压包(注:winscp和putty的关联参考下图 ) 解压文件:unzip -d 指定目录(common) [root@oracle upload]# unzip -oq common.war -d common jar包同理(unzip -oq common.jar -d common) 3.下载tomcat  将下载好的 apache-tomcat-7.0.96.tar.gz 文件拖动至winscp对应的文件夹中,打开putty进行解压:[root@localhost ~]# tar -zxvf /usr/java/apache-tomcat-7.0.82.tar.gz (/usr/java:压缩包位置)  解压完成后,进入bin目录运行./startup.sh 启动tomcat,查看是否正常启动命令:(logs目录下执行:tail -f catalina.out);查看当前tomcat有关进程:(在bin目录下)ps -ef|grep tom 如果有多个tomcat进程 kill -9全部干掉  启动成功后将tomcat关闭,进入conf目录下,编辑server.xml文件,添加相对应的文件目录信息

Lowest Common Ancestor of a Binary Tree 解答

旧时模样 提交于 2019-11-27 20:26:56
Question Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia : “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).” Given the following binary tree: root = [3,5,1,6,2,0,8,null,null,7,4] Example 1: Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1 Output: 3 Explanation: The LCA of nodes 5 and 1 is 3. Example 2: Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 4 Output:

Google Guava 类库简介(1)

妖精的绣舞 提交于 2019-11-27 16:44:53
Guava 是一个 Google 的基于java1.6的类库集合的扩展项目,包括 collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, 等等. 这些高质量的 API 可以使你的JAVa代码更加优雅,更加简洁,让你工作更加轻松愉悦。下面我们就开启优雅Java编程学习之旅!    项目相关信息:   官方首页:http://code.google.com/p/guava-libraries   官方下载:http://code.google.com/p/guava-libraries/downloads/list   官方文档:http://docs.guava-libraries.googlecode.com/git/javadoc http://www.ostools.net/apidocs/apidoc?api=guava    源码包的简单说明:   com.google.common.annotations:普通注解类型。   com.google.common.base:基本工具类库和接口。   com.google.common.cache:缓存工具包,非常简单易用且功能强大的JVM内缓存。   com