04-树5 Root of AVL Tree (25分) An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node dif ...
分类:
其他好文 时间:
2020-03-13 19:01:17
阅读次数:
77
1 class Solution { 2 public int[] twoSum(int[] nums, int target) { 3 Map<Integer, Integer> map = new HashMap<>(); 4 for (int i = 0; i < nums.length; i ...
分类:
编程语言 时间:
2020-03-12 14:41:34
阅读次数:
64
给出一个有向图,对每条边都做一次询问:
翻转这条边后,对原图的强连通分量是否有影响?
点的个数 N ≤ 1000,边的个数 M ≤ 200000。 ...
分类:
其他好文 时间:
2020-03-12 14:36:50
阅读次数:
69
class Solution { public double findMedianSortedArrays(int[] nums1, int[] nums2) { int len1 = nums1.length; int len2 = nums2.length; if (len1 == 0 && l ...
分类:
编程语言 时间:
2020-03-12 14:20:50
阅读次数:
59
"传送门" 补这道题的契机是因为烂桥杯2013的最后一题,虽然那道题暴力也能过,但看到大佬介绍的线段树做法,感觉又刷新了我对于线段树的认识,~~果然线段树是无所不能的~~。 题意 给你一个 $n$ 的全排列 $A$,你可以从中选两个不重合的区间,如果这两个区间里的所有数按升序排列是一个公差为 $1$ ...
分类:
其他好文 时间:
2020-03-12 09:53:11
阅读次数:
48
文章概要 非常感谢☆Ronny丶博主在其博文《图像分析:二值图像连通域标记》中对二值图像连通域的介绍和算法阐述,让我这个毫无数据结构算法底子的小白能够理解和复现代码。本文的目的是基于我自己的理解,对该博文中Two-Pass算法的一些优化和补充,同时也希望帮助更多像我一样的人较快地掌握连通域标记。 连 ...
分类:
编程语言 时间:
2020-03-11 23:39:13
阅读次数:
78
先上题目: C. Two operations time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given an ...
分类:
其他好文 时间:
2020-03-11 19:28:17
阅读次数:
66
Educational Codeforces Round 83 (Rated for Div. 2) = A. Two Regular Polygons 题意 给出一个正$n$边形,问能否使用这$n$个点重新构成正$m$边形 题解 正多边形转正多边形,直接判断点能不能均分就好了 代码 B. Bogo ...
分类:
其他好文 时间:
2020-03-10 21:26:10
阅读次数:
49
Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 ...
分类:
其他好文 时间:
2020-03-10 19:55:11
阅读次数:
54
[toc] 涵盖知识点:思维、dp。 比赛链接: "传送门" "A Two Regular Polygons" 题意: 问你正n边形里能不能套正m边形。 题解: 判断n是不是m倍数即可。 Accept Code: "B Bogosort" 题意: 重排数组使得不存在一对数满足两者值之差等于下标之差。 ...
分类:
其他好文 时间:
2020-03-10 14:11:34
阅读次数:
118