上一页 1 2 3 4 5 6 7 8 9 10 ··· 42 下一页
摘要: 线程池怎么实现的,核心参数讲一讲? Executors是线程池的工厂类,通过调用它的静态方法如下: 可返回一个线程池。这些静态方法统一返回一个ThreadPoolExecutor,只是参数不同。 1、corePoolSize:指定了线程池中线程的数量 2、maximumPoolSize:线程池中的最 阅读全文
posted @ 2019-03-05 10:24 Roni_i 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 1.MySQL常用引擎有哪些? A:MySQL常用的引擎有InnoDB、MyISAM、Memory,默认时InnoDB InnoDB:磁盘表,支持事务,支持行级锁,B+Tree索引 优点:具有良好的ACID特性(指数据库事务正确执行的四个基本要素的缩写) 包含Atomicity原子性、Consist 阅读全文
posted @ 2019-03-03 18:01 Roni_i 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 1.排序 冒泡排序 快速排序 归并排序 2.十进制转二进制【腾讯】 3.不用循环判断一个数是不是2的n次方【腾讯】 4.一个有n个数的数组中的数的范围为[1, n],其中有且仅有一个数有重复,找出那个数?【腾讯】 5.一个数组中,只有两个数字仅出现一次,其他数字均出现两次,找出这两个数字 所有数字依 阅读全文
posted @ 2019-03-03 11:31 Roni_i 阅读(263) 评论(0) 推荐(0) 编辑
摘要: * 场景 * 有N张火车票,每张票都有一个编号 * 同时有10个窗口对外售票 * 请写一个模拟程序 * 分析下面的程序可能会产生哪些问题? * 重复销售?超量销售? Solution1:使用线程不安全的集合而且不上锁 报错: ①程序逻辑的线程不安全:有可能多个线程涌入while循环是造成并发问题的根 阅读全文
posted @ 2019-03-03 11:09 Roni_i 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 给定一个 N 叉树,返回其节点值的层序遍历。 (即从左到右,逐层遍历)。 例如,给定一个 3叉树 : 返回其层序遍历: 说明: 阅读全文
posted @ 2019-03-01 20:44 Roni_i 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 给定二叉搜索树(BST)的根节点和一个值。 你需要在BST中找到节点值等于给定值的节点。 返回以该节点为根的子树。 如果节点不存在,则返回 NULL。 例如, 你应该返回如下子树: 在上述示例中,如果要找的值是 5,但因为没有节点值为 5,我们应该返回 NULL。 迭代: 阅读全文
posted @ 2019-03-01 19:28 Roni_i 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 给定一个 N 叉树,找到其最大深度。 最大深度是指从根节点到最远叶子节点的最长路径上的节点总数。 例如,给定一个 3叉树 : 我们应返回其最大深度,3。 说明: 阅读全文
posted @ 2019-03-01 15:53 Roni_i 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 给定一个 N 叉树,返回其节点值的后序遍历。 例如,给定一个 3叉树 : 返回其后序遍历: [5,6,3,2,4,1]. 说明: 递归法很简单,你可以使用迭代法完成此题吗? 阅读全文
posted @ 2019-03-01 15:20 Roni_i 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 给定一个 N 叉树,返回其节点值的前序遍历。 例如,给定一个 3叉树 : 返回其前序遍历: [1,3,5,6,2,4]。 说明: 递归法很简单,你可以使用迭代法完成此题吗? 阅读全文
posted @ 2019-03-01 15:14 Roni_i 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 一、Redis定义 Redis是一个开源的,基于内存的数据结构存储,可用于数据库、缓存、消息中间件。 1.1 为什么要用Redis? Redis是基于内存的,常用作缓存的一种技术,并且Redis存储的方式是以key-value的形式。 我们发现这不就是Java的Map容器所拥有的特性吗,为什么还需要 阅读全文
posted @ 2019-02-28 11:57 Roni_i 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 一 工厂模式介绍 1.1 工厂模式的定义 先来看下GOF为工厂模式的定义: “Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Metho 阅读全文
posted @ 2019-02-27 20:16 Roni_i 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 一、单例模式介绍 1.1 定义 保证一个类仅有一个实例,并提供一个访问它的全局访问点。 1.2 为什么要用单例模式? 在我们的系统中,有一些对象其实我们只需要一个,比如说:线程池、缓存、对话框、注册表、日志对象、充当打印机、显卡等设备驱动程序的对象。事实上,这一类对象只能有一个实例,如果制造出多个实 阅读全文
posted @ 2019-02-27 17:55 Roni_i 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove the n-th node from the end of list and return its head. Example: Note: Given n will always be valid. Follow up: Could you 阅读全文
posted @ 2019-02-27 15:16 Roni_i 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middl 阅读全文
posted @ 2019-02-27 15:08 Roni_i 阅读(100) 评论(0) 推荐(0) 编辑
摘要: You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai 阅读全文
posted @ 2019-02-27 14:50 Roni_i 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2019-02-27 13:41 Roni_i 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have value val. Example: 【递归】 阅读全文
posted @ 2019-02-27 13:09 Roni_i 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: Follow up:Could you do it in O(n) time and O(1) space? 阅读全文
posted @ 2019-02-27 12:39 Roni_i 阅读(96) 评论(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 longest path betwe 阅读全文
posted @ 2019-02-26 01:16 Roni_i 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look 阅读全文
posted @ 2019-02-25 23:16 Roni_i 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 22 23 24 25 26 27 28 1 21 44 45 46 47 48 29 2 20 43 58 59 60 49 30 3 19 42 57 64 61 50 31 4 18 41 56 63 62 51 32 5 17 40 55 54 53 52 33 6 16 39 38 37 阅读全文
posted @ 2019-02-25 22:41 Roni_i 阅读(536) 评论(0) 推荐(0) 编辑
摘要: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example 阅读全文
posted @ 2019-02-25 19:12 Roni_i 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. 阅读全文
posted @ 2019-02-25 15:55 Roni_i 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi 阅读全文
posted @ 2019-02-25 13:09 Roni_i 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elements initialized in nums1 and num 阅读全文
posted @ 2019-02-24 19:19 Roni_i 阅读(158) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 42 下一页