12 2017 档案

摘要:一、线程池概念 线程池: 线程池从字面意思来看,是指管理一组同构工作线程的资源池。 在线程池中执行任务比「为每一个任务分配一个线程」优势更多。 通过重用现有的线程而不是创建新线程,可以在处理多个请求时分摊在线程创建和销毁过程中产生的巨大开销。 另外一个额外的好处是,当请求到达时,工作线程通常已经存在 阅读全文
posted @ 2017-12-31 21:09 __Meng 阅读(365) 评论(0) 推荐(0) 编辑
摘要:Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文
posted @ 2017-12-31 13:37 __Meng 阅读(137) 评论(0) 推荐(0) 编辑
摘要:In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as 阅读全文
posted @ 2017-12-30 13:27 __Meng 阅读(155) 评论(0) 推荐(0) 编辑
摘要:ls命令用来显示目标列表,在Linux中是使用率较高的命令。ls命令的输出信息可以进行彩色加亮显示,以分区不同类型的文件。 阅读全文
posted @ 2017-12-26 20:27 __Meng 阅读(155) 评论(0) 推荐(0) 编辑
摘要:Reverse a singly linked list. 反转单链表 C++(9ms): 迭代 阅读全文
posted @ 2017-12-26 11:09 __Meng 阅读(121) 评论(0) 推荐(0) 编辑
摘要:Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Note: There are at 阅读全文
posted @ 2017-12-25 10:15 __Meng 阅读(193) 评论(0) 推荐(0) 编辑
摘要:Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list t 阅读全文
posted @ 2017-12-24 14:59 __Meng 阅读(170) 评论(0) 推荐(0) 编辑
摘要:You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' 阅读全文
posted @ 2017-12-23 16:09 __Meng 阅读(306) 评论(0) 推荐(1) 编辑
摘要:Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might 阅读全文
posted @ 2017-12-21 10:26 __Meng 阅读(135) 评论(0) 推荐(0) 编辑
摘要:cd命令用来切换工作目录至dirname。 其中dirName表示法可为绝对路径或相对路径。若目录名称省略,则变换至使用者的home directory(也就是刚login时所在的目录)。 另外,~也表示为home directory的意思,.则是表示目前所在的目录,..则表示目前目录位置的上一层目 阅读全文
posted @ 2017-12-20 19:25 __Meng 阅读(308) 评论(0) 推荐(0) 编辑
摘要:nl命令读取 file 参数(缺省情况下标准输入),计算输入中的行号,将计算过的行号写入标准输出。在输出中,nl命令根据您在命令行中指定的标志来计算左边的行。 输入文本必须写在逻辑页中。每个逻辑页有头、主体和页脚节(可以有空节)。除非使用-p选项,nl 命令在每个逻辑页开始的地方重新设置行号。可以单 阅读全文
posted @ 2017-12-20 17:14 __Meng 阅读(258) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all left subt 阅读全文
posted @ 2017-12-20 11:03 __Meng 阅读(139) 评论(0) 推荐(0) 编辑
摘要:cat命令 连接文件并打印到标准输出设备上,cat经常用来显示文件的内容。 注意:当文件较大时,文本在屏幕上迅速闪过(滚屏),用户往往看不清所显示的内容。因此,一般用more等命令分屏显示。 为了控制滚屏,可以按Ctrl+S键,停止滚屏;按Ctrl+Q键可以恢复滚屏。按Ctrl+C(中断)键可以终止 阅读全文
posted @ 2017-12-19 16:10 __Meng 阅读(5881) 评论(0) 推荐(0) 编辑
摘要:文件和目录管理 find命令 (在指定目录下查找文件) grep命令 (文本搜索工具) cat命令 (连接文件并打印到标准输出设备上,显示文件的内容) nl命令 (计算文件内容的行号) 目录基本操作 cd命令 (切换用户当前目录) ls命令 (显示目录内容列表) cp命令 (将源文件或目录复制到目标 阅读全文
posted @ 2017-12-19 14:58 __Meng 阅读(192) 评论(1) 推荐(0) 编辑
摘要:find命令用来在指定目录下查找文件。任何位于参数之前的字符串都将被视为欲查找的目录名。 如果使用该命令时,不设置任何参数,则find命令将在当前目录下查找子目录与文件。并且将查找到的子目录和文件全部进行显示。 -amin<分钟>:查找在指定时间曾被存取过的文件或目录,单位以分钟计算; -anewe 阅读全文
posted @ 2017-12-19 11:04 __Meng 阅读(294) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For 阅读全文
posted @ 2017-12-19 09:58 __Meng 阅读(138) 评论(0) 推荐(0) 编辑
摘要:grep(global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。 -a 不要忽略二进制数据。 -A<显示列数> 除了显示符合 阅读全文
posted @ 2017-12-18 11:33 __Meng 阅读(5449) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept 阅读全文
posted @ 2017-12-18 09:59 __Meng 阅读(130) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2017-12-17 14:09 __Meng 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Java泛型(generics)是JDK 5中引入的一个新特性,允许在定义类和接口的时候使用类型参数(type parameter)。声明的类型参数在使用时用具体的类型来替换。 泛型的本质是参数化类型,也就是说所操作的数据类型被指定为一个参数。 创建集合时就指定集合元素的类型,该集合只能保存其指定类 阅读全文
posted @ 2017-12-16 20:15 __Meng 阅读(319) 评论(0) 推荐(0) 编辑
摘要:Java为每种基本数据类型都提供了对应的包装器类型 从Java SE5开始就提供了自动装箱的特性,如果要生成一个数值为10的Integer对象,只需要这样就可以了: Integer i = 10; 这个过程中会自动根据数值创建对应的 Integer对象,这就是装箱。 实际上,执行上面那句代码的时候, 阅读全文
posted @ 2017-12-16 19:43 __Meng 阅读(353) 评论(0) 推荐(1) 编辑
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F 阅读全文
posted @ 2017-12-16 18:43 __Meng 阅读(135) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longestpath betwee 阅读全文
posted @ 2017-12-15 10:10 __Meng 阅读(135) 评论(0) 推荐(0) 编辑
摘要:You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t 阅读全文
posted @ 2017-12-14 19:30 __Meng 阅读(189) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: 阅读全文
posted @ 2017-12-13 11:08 __Meng 阅读(206) 评论(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 @ 2017-12-12 10:56 __Meng 阅读(153) 评论(0) 推荐(0) 编辑
摘要:You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Each round's operation is permane 阅读全文
posted @ 2017-12-11 10:10 __Meng 阅读(283) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Note: 以数组的形式返回每个层次上的节点的平均值 C++( 阅读全文
posted @ 2017-12-08 16:24 __Meng 阅读(171) 评论(0) 推荐(0) 编辑
摘要:大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项。 n<=39 1 1 2 3 5... C++: 一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法 1 2 3 5... f(n)=f(n-1)+f(n-2)注意 f1=1 f2=2 阅读全文
posted @ 2017-12-07 10:52 __Meng 阅读(274) 评论(0) 推荐(0) 编辑
摘要:You are given a data structure of employee information, which includes the employee's unique id, his importance value and his directsubordinates' id. 阅读全文
posted @ 2017-12-07 10:24 __Meng 阅读(226) 评论(0) 推荐(0) 编辑
摘要:Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E 阅读全文
posted @ 2017-12-06 19:17 __Meng 阅读(148) 评论(0) 推荐(0) 编辑
摘要:Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every ele 阅读全文
posted @ 2017-12-05 17:28 __Meng 阅读(210) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of 阅读全文
posted @ 2017-12-04 10:36 __Meng 阅读(279) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t 阅读全文
posted @ 2017-12-03 21:04 __Meng 阅读(302) 评论(0) 推荐(0) 编辑
摘要:We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). N 阅读全文
posted @ 2017-12-01 10:01 __Meng 阅读(170) 评论(1) 推荐(1) 编辑

点击右上角即可分享
微信分享提示