```cpp#include#include#include#include#include#define G if(top==0) { flag=1; break; }//取模和除以的时候第一个数等于0 using namespace std;stacks;long long x,top,b,fl... ...
分类:
其他好文 时间:
2019-12-22 20:26:27
阅读次数:
114
Java ConcurrentModificationException异常原因和解决方法 在前面一篇文章中提到,对Vector、ArrayList在迭代的时候如果同时对其进行修改就会抛出java.util.ConcurrentModificationException异常。下面我们就来讨论以下这个 ...
分类:
编程语言 时间:
2019-12-22 18:32:41
阅读次数:
81
Object c = Stream.of( CompletableFuture.supplyAsync(() -> { Map m = new HashMap(); try { Thread.sleep(2000); } catch (InterruptedException e) { e.prin ...
分类:
其他好文 时间:
2019-12-22 18:28:58
阅读次数:
88
需求,根据用户角色列表 查询用户列表信息 之前我们传入的参数是Array,一个数组的形式,现在我们传入的是一个List集合,其他条件没有变化。 /** * 需求:传入指定的用户角色,用户角色有1-n,获取这些用户角色下的用户列表信息 * @param roleids * @return */ pub ...
分类:
其他好文 时间:
2019-12-22 16:54:14
阅读次数:
99
给定一个二维数组,其每一行从左到右递增排序,从上到下也是递增排序。给定一个数,判断这个数是否在该二维数组中。 Consider the following matrix: [ [1, 4, 7, 11, 15], [2, 5, 8, 12, 19], [3, 6, 9, 16, 22], [10, ...
分类:
编程语言 时间:
2019-12-22 16:17:54
阅读次数:
77
实验环境 win7 下的vs2017,基本原则:throw抛出的数据类型,和cathc语句的数据类型要一致 异常的引发和异常的处理可以分布在不同函数中,所以c++的异常是跨栈的 异常是由“地地道道“的错误所引发 #define _CRT_SECURE_NO_WARNINGS #include <io ...
分类:
编程语言 时间:
2019-12-22 14:21:42
阅读次数:
81
1 class Solution: 2 def findNumbers(self, nums: List[int]) -> int: 3 n = len(nums) 4 count = 0 5 for i in range(n): 6 s = str(nums[i]) 7 if len(s) ... ...
分类:
其他好文 时间:
2019-12-22 14:16:16
阅读次数:
61
题目:操作给定的二叉树,将其变换为源二叉树的镜像。 这道题用递归来做非常简单,二叉树的镜像就是将两个子树互换,对于每个子树,都递归进行这个操作就可以。 总的来说,就是先交换root节点的两个子节点,在对左子树进行镜像,对右子树进行镜像。 c++代码如下: ...
分类:
其他好文 时间:
2019-12-22 12:42:41
阅读次数:
78
原题链接在这里:https://leetcode.com/problems/find-pivot-index/ 题目: Given an array of integers nums, write a method that returns the "pivot" index of this arr ...
分类:
其他好文 时间:
2019-12-22 11:11:09
阅读次数:
85