Myth

Results 28 issues of Myth

双指针

几种常用的 Java 数据结构(集合) List , Set, Map都是接口,前两个继承至Collection接口,Map为独立接口 Set下有HashSet,LinkedHashSet,TreeSet List下有ArrayList,Vector,LinkedList Map下有Hashtable,LinkedHashMap,HashMap,TreeMap Collection接口下还有个Queue接口,有PriorityQueue类 ![image](https://user-images.githubusercontent.com/19643013/65562308-7c8a0380-df78-11e9-94bf-4530d4a0b7b6.png) ![image](https://user-images.githubusercontent.com/19643013/65562437-0afe8500-df79-11e9-86b3-1442f1e90391.png) **HashTable已经弃用所以不包含在内**

data structure

# 目录 - Combination 组合 - Permutation 排列

## 主要内容 ## 目录

# Queue LinkedList实现了Queue结构,可以当成队列去用

basic
data structure

[1052. Grumpy Bookstore Owner](https://leetcode.com/problems/grumpy-bookstore-owner/) 实现滑动窗口 ```Java for (int i = 0; i < customers.length; ++i) { sum += grumpy[i] == 0 ? customers[i] : 0; // 以下两行代码是实现窗口的滑动(窗口内只计算grumpy为1的值) currentWindow += grumpy[i]...

WeeklyContest
again

```c++ sort(ret.begin(), ret.end(), [r0, c0](const vector & m1, const vector & m2){ return abs(r0 - m1[0]) + abs(c0 - m1[1]) < abs(r0 - m2[0]) + abs(c0 - m2[1]); }); ```...

basic

对于整数a,b来说,取模运算或者求余运算的方法要分如下两步: 1. 求整数商:c=a/b 2. 计算模或者余数:r=a-(c*b) 求模运算和求余运算在第一步不同 ,取余运算在计算商值向0方向舍弃小数位 ,取模运算在计算商值向负无穷方向舍弃小数位(整数时,是一样的) 例如:4/(-3)约等于-1.3 在取余运算时候商值向0方向舍弃小数位为-1 在取模运算时商值向负无穷方向舍弃小数位为-2 所以 4 rem(-3)=1 4 mod(-3)=-2

## -2进制数

WeeklyContest
again