├── README.md
├── .idea
├── copyright
│ └── profiles_settings.xml
├── vcs.xml
├── libraries
│ └── junit4_4.xml
├── kotlinc.xml
├── modules.xml
├── misc.xml
└── compiler.xml
├── out
└── production
│ ├── sort
│ ├── exam
│ │ ├── Main.class
│ │ ├── print.class
│ │ └── print$TreeNode.class
│ ├── sort
│ │ ├── Heapsort.class
│ │ ├── Mergesort.class
│ │ ├── bubblesort.class
│ │ ├── insertsort.class
│ │ ├── quicksort.class
│ │ ├── quicksort2.class
│ │ └── selectsort.class
│ ├── binarytree
│ │ ├── print.class
│ │ ├── TreeNode.class
│ │ └── levelprint.class
│ └── datastructure
│ │ ├── except.class
│ │ ├── queue.class
│ │ ├── stack.class
│ │ ├── linkedlist.class
│ │ ├── queue$node.class
│ │ ├── stack$node.class
│ │ └── linkedlist$node.class
│ └── Algorithm
│ ├── exam
│ ├── Main.class
│ ├── print.class
│ ├── EvenStr.class
│ ├── GoToWork.class
│ ├── TaskList.class
│ ├── findNum.class
│ ├── longStr.class
│ ├── BalanceNum.class
│ ├── BeautyStr.class
│ ├── ComplexPro.class
│ ├── MagicRing.class
│ ├── MathDream.class
│ ├── CategoryStr.class
│ ├── CommonArray.class
│ └── print$TreeNode.class
│ ├── exam2
│ ├── rank.class
│ ├── test.class
│ ├── Stone.class
│ ├── bagPro.class
│ ├── fruit.class
│ ├── renren.class
│ ├── DoubleCut.class
│ ├── ToNumber26.class
│ ├── bagPro$Bag.class
│ ├── PoliceAndThief.class
│ ├── xiaomingzuoti.class
│ ├── ShortWordChange.class
│ ├── binaryTreePrint.class
│ └── binaryTreePrint$TreeNode.class
│ ├── exam3
│ ├── Main.class
│ ├── paypal.class
│ ├── pintu.class
│ ├── MaxMulti.class
│ └── StockPrice.class
│ ├── exam4
│ ├── hat.class
│ ├── alibaba.class
│ ├── Rectangle.class
│ └── resolveBolan.class
│ ├── DP
│ └── Fibonacci.class
│ ├── format
│ └── input.class
│ ├── sort
│ ├── Heapsort.class
│ ├── Mergesort.class
│ ├── bubblesort.class
│ ├── dividesort.class
│ ├── insertsort.class
│ ├── quicksort.class
│ ├── quicksort2.class
│ └── selectsort.class
│ ├── practice
│ ├── NewSum.class
│ ├── monkey.class
│ ├── tanxin.class
│ ├── GcdAndLcm.class
│ ├── dynamic.class
│ ├── isprime.class
│ ├── ClimbStairs.class
│ ├── LongestStr.class
│ ├── TheShortest.class
│ └── resolveNum.class
│ ├── binarytree
│ ├── norecur.class
│ ├── print.class
│ ├── TreeNode.class
│ └── levelprint.class
│ └── datastructure
│ ├── except.class
│ ├── queue.class
│ ├── stack.class
│ ├── TreeNode.class
│ ├── linkedlist.class
│ ├── queue$node.class
│ ├── stack$node.class
│ └── linkedlist$node.class
├── src
├── 校招笔试
│ ├── 吉比特
│ │ └── 忘了.java
│ ├── 搜狐
│ │ ├── 兄弟串.java
│ │ ├── 走到目标点.java
│ │ └── 版本号比较.java
│ ├── 触宝
│ │ └── 题目一.java
│ ├── 链家
│ │ ├── 抽牌.java
│ │ └── 修路.java
│ ├── 快手
│ │ ├── ip.java
│ │ ├── 打饭.java
│ │ └── 爬楼梯.java
│ ├── 点我达
│ │ └── 无编程题.java
│ ├── 牛客模考
│ │ ├── t2.java
│ │ ├── t3.java
│ │ ├── test.java
│ │ └── 牛牛数星星.java
│ ├── 头条
│ │ ├── 头条三轮
│ │ │ ├── 岛屿.java
│ │ │ ├── 最长不重复子串.java
│ │ │ ├── utf8.java
│ │ │ └── ip.java
│ │ ├── A.java
│ │ ├── D.java
│ │ ├── C.java
│ │ ├── 头条二轮
│ │ │ └── Pm25.java
│ │ └── E.java
│ ├── 贝壳看房
│ │ └── test1.java
│ ├── 华为
│ │ ├── 最长连续字符串.java
│ │ ├── 大小写字母转化.java
│ │ └── 小偷偷东西问题.java
│ ├── 京东
│ │ ├── 中位数.java
│ │ ├── 修路.java
│ │ └── 对比.java
│ ├── 百度
│ │ └── test.java
│ ├── 携程
│ │ ├── bitcount.java
│ │ └── 查询满足区间的记录.java
│ ├── 拼多多
│ │ ├── 第二波
│ │ │ ├── 回合制游戏.java
│ │ │ ├── 循环小数.java
│ │ │ └── 拼词游戏.java
│ │ ├── 选靓号.java
│ │ ├── 复制可乐.java
│ │ └── 球王.java
│ ├── 知乎
│ │ └── 中位数.java
│ ├── 网易
│ │ ├── 小易的字典.java
│ │ ├── 丰收.java
│ │ └── 瞌睡.java
│ ├── 虾皮
│ │ ├── 排序.java
│ │ ├── 下台阶.java
│ │ └── 奖金.java
│ ├── 大疆
│ │ └── Test.java
│ ├── 深信服
│ │ ├── 网站开业.java
│ │ ├── 抓兔子游戏.java
│ │ └── 一百分.java
│ ├── oppo
│ │ └── 随机逆序排序.java
│ ├── 好未来
│ │ ├── 三三三.java
│ │ └── 位运算求y.java
│ ├── 爱奇艺
│ │ └── 食物.java
│ ├── 科大讯飞
│ │ └── 修改成绩.java
│ └── Keep
│ │ └── 翻转字符串.java
├── 笔试必备算法
│ ├── 全排列.java
│ ├── 字典树.java
│ ├── 最大公约数.java
│ └── N进制转换.java
├── 七月算法
│ ├── 图算法
│ │ ├── 拓扑排序.java
│ │ ├── 最小生成树.java
│ │ └── 单源点最短路.java
│ ├── 递归
│ │ └── 全排列.java
│ └── BFS和DFS
│ │ └── 求可达性的DFS.java
├── 数据结构常用算法
│ ├── 图论
│ │ ├── 拓扑.java
│ │ ├── 图搜索.java
│ │ ├── 并查集.java
│ │ ├── 弗洛伊德.java
│ │ ├── 迪杰斯特拉.java
│ │ └── 克鲁斯卡尔和普利姆.java
│ ├── 二叉树
│ │ ├── 字典树.java
│ │ └── 非递归的树遍历.java
│ ├── 字符串
│ │ ├── kmp.java
│ │ └── 回文.java
│ ├── 数论
│ │ ├── 全排序.java
│ │ └── 最大公约数和最小公倍数.java
│ ├── 贪心
│ │ ├── 近似解.java
│ │ └── 如何排课上的课最多.java
│ ├── DP
│ │ ├── 最长公共子串.java
│ │ ├── 最长公共子序列.java
│ │ └── 从A到B的走法总数.java
│ ├── 哈希表
│ │ └── 统计次数.java
│ ├── 数组和链表
│ │ ├── 循环数组.java
│ │ └── 相交链表.java
│ ├── 队列和栈
│ │ ├── 括号匹配.java
│ │ ├── 最小值栈.java
│ │ ├── 进制转换.java
│ │ └── 栈和队列的转换.java
│ ├── 枚举到递归再到搜索
│ │ ├── BFS.java
│ │ ├── DFS.java
│ │ └── 八皇后回溯.java
│ ├── 二进制
│ │ ├── 数组唯一的数.java
│ │ └── 数组只出现一次的两个数.java
│ ├── 排序
│ │ ├── 桶排序.java
│ │ ├── 插入排序.java
│ │ ├── 计数排序.java
│ │ ├── 选择排序.java
│ │ ├── 冒泡.java
│ │ ├── 快排.java
│ │ └── 归并.java
│ └── 二分查找
│ │ └── 二分.java
├── 剑指offer二刷
│ ├── 数组
│ │ ├── 数据流的中位数.java
│ │ ├── 和为s的连续正数序列.java
│ │ ├── 旋转数组的最小数字.java
│ │ └── 把数组排成最小的数.java
│ ├── 链表
│ │ ├── Node.java
│ │ ├── 链表环的入口.java
│ │ └── 从尾到头打印链表.java
│ ├── 树
│ │ ├── TreeNode.java
│ │ └── 二叉树的深度.java
│ └── 字符串
│ │ ├── 翻转单词顺序列.java
│ │ └── 数据流字符出现的个数.java
├── 牛客往年真题
│ ├── 笔试17年
│ │ ├── 京东
│ │ │ ├── 保卫方案.java
│ │ │ ├── 幸运数.java
│ │ │ ├── 集合.java
│ │ │ └── 进制均值.java
│ │ ├── 头条
│ │ │ ├── 字典序.java
│ │ │ ├── 异或.java
│ │ │ └── 头条校招.java
│ │ ├── 滴滴
│ │ │ └── 末尾0的个数.java
│ │ ├── 网易
│ │ │ ├── 暗黑字符串.java
│ │ │ ├── 星际穿越.java
│ │ │ ├── 优雅的数.java
│ │ │ ├── 计算糖果.java
│ │ │ ├── 数字翻转.java
│ │ │ ├── 买苹果.java
│ │ │ ├── 下厨房.java
│ │ │ ├── 斐波那契数.java
│ │ │ ├── 跳石板.java
│ │ │ ├── 藏宝图.java
│ │ │ ├── 解救小易.java
│ │ │ ├── 数字游戏.java
│ │ │ └── 统计回文.java
│ │ ├── 腾讯
│ │ │ ├── 游戏任务标记.java
│ │ │ ├── geohash编码.java
│ │ │ └── 素数对.java
│ │ ├── 美团
│ │ │ ├── 丢失的三个数.java
│ │ │ ├── 网格走法数目.java
│ │ │ └── 拼凑面额.java
│ │ └── 网易游戏
│ │ │ └── 会话列表.java
│ └── 笔试16年
│ │ ├── 美团
│ │ ├── 字符串计数.java
│ │ ├── 最大差值.java
│ │ ├── 棋子翻转.java
│ │ └── 直方图内最大矩形.java
│ │ └── 小米
│ │ └── 懂二进制.java
└── 过去笔试记录
│ ├── In2017
│ ├── exam2
│ │ ├── test.java
│ │ ├── rank.java
│ │ ├── ToNumber26.java
│ │ ├── xiaomingzuoti.java
│ │ ├── fruit.java
│ │ ├── renren.java
│ │ └── PoliceAndThief.java
│ ├── exam3
│ │ ├── pintu.java
│ │ ├── MaxMulti.java
│ │ └── carLoad.java
│ ├── exam4
│ │ ├── Island.java
│ │ ├── SimilarString.java
│ │ ├── Rectangle.java
│ │ ├── StupidBear.java
│ │ └── hat.java
│ ├── exam
│ │ ├── BeautyStr.java
│ │ ├── ComplexPro.java
│ │ ├── Main.java
│ │ ├── CategoryStr.java
│ │ ├── MathDream.java
│ │ ├── longStr.java
│ │ ├── findNum.java
│ │ ├── EvenStr.java
│ │ ├── BalanceNum.java
│ │ └── print.java
│ └── ali
│ │ └── binsearch.java
│ ├── In2018
│ ├── Written
│ │ ├── 京东
│ │ │ ├── test.java
│ │ │ ├── 分解整数.java
│ │ │ └── 移除字符变成回文子串.java
│ │ ├── 头条
│ │ │ ├── 调用次数.java
│ │ │ ├── 跳板.java
│ │ │ ├── input.java
│ │ │ └── magic次数.java
│ │ ├── 头条2
│ │ │ ├── Test.java
│ │ │ └── t1.java
│ │ ├── 腾讯
│ │ │ ├── input.java
│ │ │ ├── 前端
│ │ │ │ └── Tencent6.java
│ │ │ └── 翻转数列.java
│ │ ├── 百度
│ │ │ ├── testint.java
│ │ │ ├── testlong.java
│ │ │ └── 平行四边形.java
│ │ ├── Test.java
│ │ ├── 头条3
│ │ │ ├── t2.java
│ │ │ ├── t3.java
│ │ │ ├── t4.java
│ │ │ ├── test.java
│ │ │ └── t1.java
│ │ ├── 招行信用卡
│ │ │ └── test.java
│ │ ├── 网易互联网
│ │ │ ├── Test.java
│ │ │ └── NumCouple.java
│ │ └── 牛客模考
│ │ │ ├── 生活费.java
│ │ │ └── 吃雪糕.java
│ └── Interview
│ │ ├── 酷家乐
│ │ └── Date.java
│ │ └── 头条
│ │ ├── Node.java
│ │ ├── getTheRightBiggerNum.java
│ │ └── karray.java
│ ├── Basic
│ ├── binarytree
│ │ ├── norecur.java
│ │ ├── TreeNode.java
│ │ ├── print.java
│ │ └── levelprint.java
│ ├── practice
│ │ ├── NewSum.java
│ │ ├── isprime.java
│ │ ├── monkey.java
│ │ ├── resolveNum.java
│ │ ├── DP
│ │ │ └── Fibonacci.java
│ │ ├── GcdAndLcm.java
│ │ ├── dynamic.java
│ │ ├── LongestStr.java
│ │ └── ClimbStairs.java
│ ├── datastructure
│ │ ├── TreeNode.java
│ │ ├── except.java
│ │ ├── LRU.java
│ │ ├── queue.java
│ │ └── stack.java
│ └── sort
│ │ ├── dividesort.java
│ │ ├── insertsort.java
│ │ ├── bubblesort.java
│ │ ├── selectsort.java
│ │ ├── quicksort2.java
│ │ └── quicksort.java
│ └── Format
│ ├── 输入一个数和一个数组.java
│ ├── 输入多个数和多行数.java
│ └── 输入数组或多个数.java
├── .gitattributes
├── .gitignore
└── Algorithm.iml
/README.md:
--------------------------------------------------------------------------------
1 | # Algorithm
2 | 经典算法、笔试题
3 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/out/production/sort/exam/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/exam/Main.class
--------------------------------------------------------------------------------
/out/production/sort/exam/print.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/exam/print.class
--------------------------------------------------------------------------------
/out/production/sort/sort/Heapsort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/sort/Heapsort.class
--------------------------------------------------------------------------------
/src/校招笔试/吉比特/忘了.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.吉比特;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/3.
5 | */
6 | public class 忘了 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/搜狐/兄弟串.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.搜狐;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/13.
5 | */
6 | public class 兄弟串 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/触宝/题目一.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.触宝;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/3.
5 | */
6 | public class 题目一 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/链家/抽牌.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.链家;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/8/18.
5 | */
6 | public class 抽牌 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/笔试必备算法/全排列.java:
--------------------------------------------------------------------------------
1 | package 笔试必备算法;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/6.
5 | */
6 | public class 全排列 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/笔试必备算法/字典树.java:
--------------------------------------------------------------------------------
1 | package 笔试必备算法;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/6.
5 | */
6 | public class 字典树 {
7 | }
8 |
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/Main.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/print.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/print.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/rank.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/rank.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/test.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/test.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam3/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam3/Main.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam4/hat.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam4/hat.class
--------------------------------------------------------------------------------
/out/production/sort/sort/Mergesort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/sort/Mergesort.class
--------------------------------------------------------------------------------
/out/production/sort/sort/bubblesort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/sort/bubblesort.class
--------------------------------------------------------------------------------
/out/production/sort/sort/insertsort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/sort/insertsort.class
--------------------------------------------------------------------------------
/out/production/sort/sort/quicksort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/sort/quicksort.class
--------------------------------------------------------------------------------
/out/production/sort/sort/quicksort2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/sort/quicksort2.class
--------------------------------------------------------------------------------
/out/production/sort/sort/selectsort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/sort/selectsort.class
--------------------------------------------------------------------------------
/src/七月算法/图算法/拓扑排序.java:
--------------------------------------------------------------------------------
1 | package 七月算法.图算法;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/16.
5 | */
6 | public class 拓扑排序 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/七月算法/图算法/最小生成树.java:
--------------------------------------------------------------------------------
1 | package 七月算法.图算法;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/16.
5 | */
6 | public class 最小生成树 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/图论/拓扑.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.图论;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 拓扑 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/快手/ip.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.快手;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/10.
5 | */
6 | public class ip {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/src/校招笔试/点我达/无编程题.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.点我达;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/3.
5 | */
6 | public class 无编程题 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/牛客模考/t2.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.牛客模考;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/14.
5 | */
6 | public class t2 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/牛客模考/t3.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.牛客模考;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/14.
5 | */
6 | public class t3 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/牛客模考/test.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.牛客模考;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/14.
5 | */
6 | public class test {
7 | }
8 |
--------------------------------------------------------------------------------
/out/production/Algorithm/DP/Fibonacci.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/DP/Fibonacci.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/EvenStr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/EvenStr.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/GoToWork.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/GoToWork.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/TaskList.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/TaskList.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/findNum.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/findNum.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/longStr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/longStr.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/Stone.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/Stone.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/bagPro.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/bagPro.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/fruit.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/fruit.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/renren.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/renren.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam3/paypal.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam3/paypal.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam3/pintu.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam3/pintu.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam4/alibaba.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam4/alibaba.class
--------------------------------------------------------------------------------
/out/production/Algorithm/format/input.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/format/input.class
--------------------------------------------------------------------------------
/out/production/Algorithm/sort/Heapsort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/sort/Heapsort.class
--------------------------------------------------------------------------------
/out/production/sort/binarytree/print.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/binarytree/print.class
--------------------------------------------------------------------------------
/src/七月算法/图算法/单源点最短路.java:
--------------------------------------------------------------------------------
1 | package 七月算法.图算法;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/16.
5 | */
6 | public class 单源点最短路 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/二叉树/字典树.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.二叉树;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 字典树 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/图论/图搜索.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.图论;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 图搜索 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/图论/并查集.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.图论;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 并查集 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/图论/弗洛伊德.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.图论;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 弗洛伊德 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/字符串/kmp.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.字符串;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class kmp {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/字符串/回文.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.字符串;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 回文 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/数论/全排序.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.数论;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 全排序 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/贪心/近似解.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.贪心;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 近似解 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/头条/头条三轮/岛屿.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.头条.头条三轮;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/9.
5 | */
6 | public class 岛屿 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/贝壳看房/test1.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.贝壳看房;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/3.
5 | */
6 | public class test1 {
7 | }
8 |
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/BalanceNum.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/BalanceNum.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/BeautyStr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/BeautyStr.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/ComplexPro.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/ComplexPro.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/MagicRing.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/MagicRing.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/MathDream.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/MathDream.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/DoubleCut.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/DoubleCut.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam3/MaxMulti.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam3/MaxMulti.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam4/Rectangle.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam4/Rectangle.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/NewSum.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/NewSum.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/monkey.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/monkey.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/tanxin.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/tanxin.class
--------------------------------------------------------------------------------
/out/production/Algorithm/sort/Mergesort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/sort/Mergesort.class
--------------------------------------------------------------------------------
/out/production/Algorithm/sort/bubblesort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/sort/bubblesort.class
--------------------------------------------------------------------------------
/out/production/Algorithm/sort/dividesort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/sort/dividesort.class
--------------------------------------------------------------------------------
/out/production/Algorithm/sort/insertsort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/sort/insertsort.class
--------------------------------------------------------------------------------
/out/production/Algorithm/sort/quicksort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/sort/quicksort.class
--------------------------------------------------------------------------------
/out/production/Algorithm/sort/quicksort2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/sort/quicksort2.class
--------------------------------------------------------------------------------
/out/production/Algorithm/sort/selectsort.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/sort/selectsort.class
--------------------------------------------------------------------------------
/out/production/sort/binarytree/TreeNode.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/binarytree/TreeNode.class
--------------------------------------------------------------------------------
/out/production/sort/datastructure/except.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/datastructure/except.class
--------------------------------------------------------------------------------
/out/production/sort/datastructure/queue.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/datastructure/queue.class
--------------------------------------------------------------------------------
/out/production/sort/datastructure/stack.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/datastructure/stack.class
--------------------------------------------------------------------------------
/out/production/sort/exam/print$TreeNode.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/exam/print$TreeNode.class
--------------------------------------------------------------------------------
/src/数据结构常用算法/DP/最长公共子串.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.DP;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 最长公共子串 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/DP/最长公共子序列.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.DP;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 最长公共子序列 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/哈希表/统计次数.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.哈希表;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 统计次数 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/图论/迪杰斯特拉.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.图论;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 迪杰斯特拉 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/数组和链表/循环数组.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.数组和链表;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 循环数组 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/数组和链表/相交链表.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.数组和链表;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 相交链表 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/队列和栈/括号匹配.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.队列和栈;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 括号匹配 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/队列和栈/最小值栈.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.队列和栈;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 最小值栈 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/队列和栈/进制转换.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.队列和栈;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 进制转换 {
7 | }
8 |
--------------------------------------------------------------------------------
/out/production/Algorithm/binarytree/norecur.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/binarytree/norecur.class
--------------------------------------------------------------------------------
/out/production/Algorithm/binarytree/print.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/binarytree/print.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/CategoryStr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/CategoryStr.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/CommonArray.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/CommonArray.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/ToNumber26.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/ToNumber26.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/bagPro$Bag.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/bagPro$Bag.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam3/StockPrice.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam3/StockPrice.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam4/resolveBolan.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam4/resolveBolan.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/GcdAndLcm.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/GcdAndLcm.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/dynamic.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/dynamic.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/isprime.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/isprime.class
--------------------------------------------------------------------------------
/out/production/sort/binarytree/levelprint.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/binarytree/levelprint.class
--------------------------------------------------------------------------------
/src/剑指offer二刷/数组/数据流的中位数.java:
--------------------------------------------------------------------------------
1 | package 剑指offer二刷.数组;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 数据流的中位数 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/DP/从A到B的走法总数.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.DP;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 从A到B的走法总数 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/二叉树/非递归的树遍历.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.二叉树;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 非递归的树遍历 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/图论/克鲁斯卡尔和普利姆.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.图论;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 克鲁斯卡尔和普利姆 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/贪心/如何排课上的课最多.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.贪心;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 如何排课上的课最多 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/队列和栈/栈和队列的转换.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.队列和栈;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 栈和队列的转换 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/校招笔试/头条/头条三轮/最长不重复子串.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.头条.头条三轮;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/9.
5 | */
6 | public class 最长不重复子串 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/京东/保卫方案.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.京东;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/6.
5 | */
6 | public class 保卫方案 {
7 | }
8 |
--------------------------------------------------------------------------------
/out/production/Algorithm/binarytree/TreeNode.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/binarytree/TreeNode.class
--------------------------------------------------------------------------------
/out/production/Algorithm/datastructure/except.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/datastructure/except.class
--------------------------------------------------------------------------------
/out/production/Algorithm/datastructure/queue.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/datastructure/queue.class
--------------------------------------------------------------------------------
/out/production/Algorithm/datastructure/stack.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/datastructure/stack.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam/print$TreeNode.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam/print$TreeNode.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/PoliceAndThief.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/PoliceAndThief.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/xiaomingzuoti.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/xiaomingzuoti.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/ClimbStairs.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/ClimbStairs.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/LongestStr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/LongestStr.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/TheShortest.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/TheShortest.class
--------------------------------------------------------------------------------
/out/production/Algorithm/practice/resolveNum.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/practice/resolveNum.class
--------------------------------------------------------------------------------
/out/production/sort/datastructure/linkedlist.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/datastructure/linkedlist.class
--------------------------------------------------------------------------------
/out/production/sort/datastructure/queue$node.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/datastructure/queue$node.class
--------------------------------------------------------------------------------
/out/production/sort/datastructure/stack$node.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/datastructure/stack$node.class
--------------------------------------------------------------------------------
/src/数据结构常用算法/数论/最大公约数和最小公倍数.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.数论;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 最大公约数和最小公倍数 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/枚举到递归再到搜索/BFS.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.枚举到递归再到搜索;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class BFS {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/枚举到递归再到搜索/DFS.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.枚举到递归再到搜索;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class DFS {
7 | }
8 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/枚举到递归再到搜索/八皇后回溯.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.枚举到递归再到搜索;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 八皇后回溯 {
7 | }
8 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam2/test.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam2;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/3/26.
5 | */
6 | public class test {
7 | }
8 |
--------------------------------------------------------------------------------
/out/production/Algorithm/binarytree/levelprint.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/binarytree/levelprint.class
--------------------------------------------------------------------------------
/out/production/Algorithm/datastructure/TreeNode.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/datastructure/TreeNode.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/ShortWordChange.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/ShortWordChange.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/binaryTreePrint.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/binaryTreePrint.class
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam3/pintu.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam3;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/4/11.
5 | */
6 | public class pintu {
7 | }
8 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam4/Island.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam4;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/5/7.
5 | */
6 | public class Island {
7 | }
8 |
--------------------------------------------------------------------------------
/out/production/Algorithm/datastructure/linkedlist.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/datastructure/linkedlist.class
--------------------------------------------------------------------------------
/out/production/Algorithm/datastructure/queue$node.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/datastructure/queue$node.class
--------------------------------------------------------------------------------
/out/production/Algorithm/datastructure/stack$node.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/datastructure/stack$node.class
--------------------------------------------------------------------------------
/out/production/sort/datastructure/linkedlist$node.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/sort/datastructure/linkedlist$node.class
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/京东/test.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.京东;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/4/9.
5 | */
6 | public class test {
7 | }
8 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/binarytree/norecur.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.binarytree;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/3/10.
5 | */
6 | public class norecur {
7 | }
8 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/头条/调用次数.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.头条;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/3/24.
5 | */
6 | public class 调用次数 {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/头条2/Test.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.头条2;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/4/15.
5 | */
6 | public class Test {
7 | }
8 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/腾讯/input.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.腾讯;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/4/5.
5 | */
6 | public class input {
7 | }
8 |
--------------------------------------------------------------------------------
/out/production/Algorithm/datastructure/linkedlist$node.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/datastructure/linkedlist$node.class
--------------------------------------------------------------------------------
/out/production/Algorithm/exam2/binaryTreePrint$TreeNode.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/h2pl/Algorithm/HEAD/out/production/Algorithm/exam2/binaryTreePrint$TreeNode.class
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam4/SimilarString.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam4;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/5/7.
5 | */
6 | public class SimilarString {
7 | }
8 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/百度/testint.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.百度;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/4/18.
5 | */
6 | public class testint {
7 | }
8 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam2/rank.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam2;
2 |
3 |
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/4/1.
7 | */
8 | public class rank {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/校招笔试/华为/最长连续字符串.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.华为;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/8/1.
7 | */
8 | public class 最长连续字符串 {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/校招笔试/京东/中位数.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.京东;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/9.
5 | */
6 | public class 中位数 {
7 | public static void main(String[] args) {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/校招笔试/快手/打饭.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.快手;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/10.
5 | */
6 | public class 打饭 {
7 | public static void main(String[] args) {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/二进制/数组唯一的数.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.二进制;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 数组唯一的数 {
7 | public static void main(String[] args) {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/头条/字典序.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.头条;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/6.
5 | */
6 | public class 字典序 {
7 | public static void main(String[] args) {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/头条/异或.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.头条;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/6.
5 | */
6 | public class 异或 {
7 | public static void main(String[] args) {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/practice/NewSum.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.practice;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/3/10.
5 | */
6 | public class NewSum {
7 |
8 | void sum(int n){
9 |
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/二进制/数组只出现一次的两个数.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.二进制;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 数组只出现一次的两个数 {
7 | public static void main(String[] args) {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/Test.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/5/23.
5 | */
6 | public class Test {
7 | public static void main(String[] args) {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/校招笔试/百度/test.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.百度;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/9/11.
5 | */
6 | public class test {
7 | public static void main(String[] args) {
8 |
9 | System.out.println();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/剑指offer二刷/链表/Node.java:
--------------------------------------------------------------------------------
1 | package 剑指offer二刷.链表;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class Node{
7 | Node next;
8 | int val;
9 | public Node(int val) {
10 | this.val = val;
11 | }
12 | }
--------------------------------------------------------------------------------
/.idea/libraries/junit4_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam4/Rectangle.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam4;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/4/27.
5 | */
6 | public class Rectangle {
7 | public static void main(String []args) {
8 | System.out.println(3);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/头条3/t2.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.头条3;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/5/12.
5 | */
6 | public class t2 {
7 | public static void main(String[] args) {
8 | System.out.println();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/头条3/t3.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.头条3;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/5/12.
5 | */
6 | public class t3 {
7 | public static void main(String[] args) {
8 | System.out.println();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/头条3/t4.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.头条3;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/5/12.
5 | */
6 | public class t4 {
7 | public static void main(String[] args) {
8 | System.out.println();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/招行信用卡/test.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.招行信用卡;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/3/29.
5 | */
6 | public class test {
7 | public static void main(String[] args) {
8 | System.out.println("(()),()()");
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam/BeautyStr.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/3/23.
5 | */
6 | public class BeautyStr {
7 | public int BeautyStr(int N,int M,int K){
8 | if(M==0 || M==0 )return 0;
9 | return 0;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/剑指offer二刷/树/TreeNode.java:
--------------------------------------------------------------------------------
1 | package 剑指offer二刷.树;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class TreeNode {
7 | TreeNode left;
8 | TreeNode right;
9 | int val;
10 | public TreeNode(int val) {
11 | this.val = val;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/剑指offer二刷/链表/链表环的入口.java:
--------------------------------------------------------------------------------
1 | package 剑指offer二刷.链表;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 链表环的入口 {
7 |
8 | public static void main(String[] args) {
9 |
10 | }
11 | public static void findNode(Node A, Node B ) {
12 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/网易互联网/Test.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.网易互联网;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/3/27.
5 | */
6 | public class Test {
7 | public static void main(String[] args) {
8 | String a = null;
9 |
10 | System.out.println(a);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/datastructure/TreeNode.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.datastructure;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/4/13.
5 | */
6 | public class TreeNode {
7 | int data;
8 | TreeNode left;
9 | TreeNode right;
10 | TreeNode(int data){
11 | this.data=data;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Interview/酷家乐/Date.java:
--------------------------------------------------------------------------------
1 | package mianshi.kujiale;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/3/2.
5 | */
6 | public class Date
7 | {
8 | public int Year;
9 | public int Month;
10 | public int Day;
11 | public int Hour;
12 | public int Minute;
13 | public int Second;
14 | }
15 |
--------------------------------------------------------------------------------
/src/校招笔试/头条/A.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.头条;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/8/12.
7 | */
8 | public class A {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | func();
12 | }
13 | public static void func() {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/校招笔试/头条/D.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.头条;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/8/12.
7 | */
8 | public class D {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | func();
12 | }
13 | public static void func() {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/binarytree/TreeNode.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.binarytree;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/3/10.
5 | */
6 | class TreeNode{
7 | TreeNode left=null;
8 | TreeNode right=null;
9 | int val;
10 | TreeNode(int val){
11 | this.val=val;
12 |
13 | }
14 | TreeNode(){
15 | val=0;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/practice/isprime.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.practice;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/3/10.
5 | */
6 | public class isprime {
7 | boolean isprime(int x){
8 | for(int i=2;i arr[i]) {
14 | return arr[i];
15 | }
16 | }
17 | return arr[0];
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/笔试必备算法/最大公约数.java:
--------------------------------------------------------------------------------
1 | package 笔试必备算法;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/6.
5 | */
6 | public class 最大公约数 {
7 |
8 | public static void main(String[] args) {
9 |
10 | int a = 30, b = 25;//a 是分母
11 | int gcd = gcd(a,b);
12 | System.out.println( b/gcd + "/" + a/gcd); // 输出了 5/6
13 | }
14 | public static int gcd(int x, int y){ // 这个是运用辗转相除法求 两个数的 最大公约数 看不懂可以百度 // 下
15 | if(y == 0)
16 | return x;
17 | else
18 | return gcd(y,x%y);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/滴滴/末尾0的个数.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.滴滴;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/5/27.
7 | */
8 | public class 末尾0的个数 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int n = scanner.nextInt();
12 | int cnt = 0;
13 | for (int i = 1;i <= n;i ++) {
14 | int temp = i;
15 | while (temp % 5 == 0) {
16 | temp = temp/5;
17 | cnt++;
18 | }
19 | }
20 | System.out.println(cnt);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/datastructure/except.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.datastructure;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/3/10.
5 | */
6 | public class except {
7 | public static void fun()throws Exception{
8 |
9 |
10 | }
11 | public static void exe()throws Exception{
12 | int i=1/0;
13 | fun();
14 | }
15 | public static void main(String args[])throws Exception{
16 |
17 | try {
18 | exe();
19 | }catch (Exception e){
20 | e.printStackTrace();
21 | System.out.println("sadas");
22 | }
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/practice/resolveNum.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.practice;
2 |
3 | import org.junit.Test;
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/3/10.
7 | */
8 | public class resolveNum {
9 | void resolve(int num){
10 | int i;
11 | for (i=2;i extends LinkedHashMap {
11 | //定义缓存的容量
12 | private int capacity;
13 | LRULinkedHashMap(int capacity) {
14 | this.capacity = capacity;
15 | }
16 |
17 | @Override
18 | protected boolean removeEldestEntry(Map.Entry eldest) {
19 | return size() > capacity;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/practice/DP/Fibonacci.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.practice.DP;
2 |
3 | import org.junit.Test;
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/3/19.
7 | */
8 | public class Fibonacci {
9 | public int Fibonacci(int n) {
10 | if(n==0 ||n==1){
11 | return n;
12 | }
13 | int []arr=new int[n];
14 |
15 | arr[0]=1;
16 | arr[1]=1;
17 | for(int i=2;i= 1; i --) {
17 | if (i * (i + 1) <= h) {
18 | return i;
19 | }
20 | }
21 | return 0;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/排序/桶排序.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.排序;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 桶排序 {
7 | public static void main(String[] args) {
8 | int []arr = {1,3,41,5,8,8,4,61};
9 | tongSort(arr, 61);
10 | }
11 | public static void tongSort(int []arr, int max) {
12 | int []map = new int[max + 1];
13 | for (int i = 0;i < arr.length;i ++) {
14 | map[arr[i]] += 1;
15 | }
16 | for (int i = 0;i < map.length;i ++) {
17 | int j = map[i];
18 | while (j -- > 0) {
19 | System.out.print(i + " ");
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam/Main.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/3/9.
7 | */
8 | public class Main {
9 | static int levelup(int n){
10 | for(int j=1;j<=n;j++)
11 | {
12 |
13 | }
14 | for(int k=1;k<=n;k++)
15 | {
16 |
17 | }
18 | return 1;
19 | }
20 | public static void main(int n){
21 | Scanner scanner=new Scanner(System.in);
22 | while(scanner.hasNext()){
23 | int x = scanner.nextInt();
24 | System.out.println(Main.levelup(x));
25 |
26 | }
27 |
28 |
29 | }
30 |
31 |
32 | }
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/剑指offer二刷/链表/从尾到头打印链表.java:
--------------------------------------------------------------------------------
1 | package 剑指offer二刷.链表;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 从尾到头打印链表 {
7 | public static void main(String[] args) {
8 | Node head = new Node(0);
9 | Node p = head;
10 | for (int i = 1;i < 10;i ++) {
11 | Node node = new Node(i);
12 | p.next = node;
13 | p = p.next;
14 | }
15 | printReverse(head);
16 | }
17 | public static void printReverse(Node node) {
18 | if (node.next != null) {
19 | printReverse(node.next);
20 | }
21 | System.out.print(node.val + " ");
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Format/输入一个数和一个数组.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Format;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/4/5.
7 | */
8 | public class 输入一个数和一个数组 {
9 | public static void 输入一个数n和一个大小为n的数组(String[] args) {
10 | Scanner input = new Scanner(System.in);
11 | String temp = input.nextLine();
12 | String[] ss = temp.trim().split(" ");
13 | int n = Integer.parseInt(ss[0]);
14 | String temp2 = input.nextLine();
15 | String[] ss2 = temp2.trim().split(" ");
16 |
17 | int []num=new int[n];
18 | for(int i=0;i= 1 && temp < arr[j - 1]) {
19 | arr[j] = arr[j - 1];
20 | j --;
21 | }
22 | arr[j] = temp;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/腾讯/游戏任务标记.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.腾讯;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/6/5.
7 | */
8 | public class 游戏任务标记 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int []arr = new int[1025];
12 | while (scanner.hasNextInt()) {
13 | int a = scanner.nextInt();
14 | int b = scanner.nextInt();
15 | System.out.println(task(a, b , arr));
16 | }
17 | }
18 | public static int task(int a,int b, int []arr) {
19 | if (a > 1024 || a < 1 || b > 1024 || b < 1) return -1;
20 | arr[a] = 1;
21 | return arr[b];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/校招笔试/头条/C.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.头条;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/8/12.
7 | */
8 | public class C {
9 |
10 | public static void main(String[] args) {
11 | Scanner scanner = new Scanner(System.in);
12 | int n = scanner.nextInt();
13 | int []per = new int[n];
14 | int []team = new int[n];
15 | for (int i = 0;i < n;i ++) {
16 | per[i] = scanner.nextInt();
17 | }
18 | for (int i = 0;i < n;i ++) {
19 | team[i] = scanner.nextInt();
20 | }
21 | func(per, team);
22 | }
23 | public static void func(int []per, int[] team) {
24 | System.out.println(10);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/校招笔试/拼多多/第二波/回合制游戏.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.拼多多.第二波;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/8/30.
7 | */
8 | public class 回合制游戏 {
9 | public static void main(String[] args) {
10 | Scanner sc = new Scanner(System.in);
11 | int n = sc.nextInt();
12 | int m = sc.nextInt();
13 | int k = sc.nextInt();
14 | int cnt = k / m;
15 | if(cnt >= 2){
16 | int size = n / k;
17 | if(n % k <= m){
18 | System.out.println(size * 2 + 1);
19 | }else{
20 | System.out.println(size * 2 + 2);
21 | }
22 | }else{
23 | System.out.println(n / m + 1);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/网易/优雅的数.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.网易;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/5/24.
7 | */
8 | public class 优雅的数 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int n = scanner.nextInt();
12 | System.out.println(elegant(n));
13 | }
14 | public static int elegant(int n) {
15 | int cnt = 0;
16 | int r = (int) Math.pow(n, 0.5);
17 | for (int i = 1;i <= r;i ++) {
18 | int m = n - i * i;
19 | if (Math.pow(m, 0.5) == Math.ceil(Math.pow(m, 0.5))) {
20 | cnt ++;
21 | }
22 | }
23 | return cnt * 4;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/网易/计算糖果.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.网易;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/5/24.
7 | */
8 | public class 计算糖果 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int M = scanner.nextInt();
12 | int N = scanner.nextInt();
13 | int P = scanner.nextInt();
14 | int Q = scanner.nextInt();
15 | if (M - P + N + Q != 0) {
16 | System.out.println("No");
17 | }else {
18 | int A = P - (N + Q) / 2;
19 | int B = (N + Q) / 2;
20 | int C = (Q - N) / 2;
21 | System.out.println(A + " " + B + " " + C);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/剑指offer二刷/树/二叉树的深度.java:
--------------------------------------------------------------------------------
1 | package 剑指offer二刷.树;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 二叉树的深度 {
7 | public static void main(String[] args) {
8 | TreeNode node1 = new TreeNode(1);
9 | TreeNode node2 = new TreeNode(2);
10 | TreeNode node3 = new TreeNode(3);
11 | node1.left = node2;
12 | node1.right = node3;
13 | System.out.println(depth(node1));
14 | }
15 | public static int depth(TreeNode root) {
16 | if (root == null) {
17 | return 0;
18 | }
19 | int left = depth(root.left);
20 | int right = depth(root.right);
21 | int depth = (left > right ? left : right) + 1;
22 | return depth;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/校招笔试/知乎/中位数.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.知乎;
2 |
3 | import java.util.Arrays;
4 | import java.util.Scanner;
5 |
6 | /**
7 | * Created by 周杰伦 on 2018/8/25.
8 | */
9 | public class 中位数 {
10 | public static void main(String[] args) {
11 | Scanner scanner = new Scanner(System.in);
12 | System.out.println("1,3,7,4,9");
13 | }
14 |
15 | public int medium(int []a, int[]b) {
16 | int []arr = new int[a.length + b.length];
17 | int k = 0;
18 | for (int i = 0;i < a.length;i ++) {
19 | arr[k ++] = a[i];
20 | }
21 | for (int i = 0;i < b.length;i ++) {
22 | arr[k ++] = b[i];
23 | }
24 | Arrays.sort(arr);
25 | return arr[arr.length / 2];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/sort/dividesort.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.sort;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/3/10.
5 | */
6 | public class dividesort {
7 | public static int dividesort(int []num, int x){
8 | int left=0;
9 | int right=num.length-1;
10 | while(left<=right) {
11 | int mid = (left + right) / 2;
12 | if(num[mid]>x){
13 | right=mid-1;
14 | }
15 | else if(num[mid] 0) {
23 | arr[k ++] = i;
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/校招笔试/网易/小易的字典.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.网易;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/8/11.
7 | */
8 | public class 小易的字典 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int n = scanner.nextInt();
12 | int m = scanner.nextInt();
13 | int k = scanner.nextInt();
14 | word(n, m, k);
15 | }
16 | public static void word(int n, int m, int k) {
17 | if (k > f(n, m)) {
18 | System.out.println(-1);
19 | }else {
20 | System.out.println("zzaa");
21 | }
22 | }
23 |
24 | public static int f(int x, int y) {
25 | if (x == 0 || y == 0) return 1;
26 | return f(x - 1, y) + f(x, y - 1);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/校招笔试/链家/修路.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.链家;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/8/18.
7 | */
8 | public class 修路 {
9 |
10 | public static void main(String[] args) {
11 | Scanner sc = new Scanner(System.in);
12 | int n = sc.nextInt();
13 | int i=0;
14 | int []arr = new int[n];
15 | while(i0; i--) {
15 | int j = 1;
16 | int sum = i;
17 | int temp=i;
18 | while (j < day && sum <= count) {
19 | temp=temp%2==1?temp/2+1:temp/2;
20 | sum += temp;
21 | j++;
22 | }
23 | if (j == day && sum <= count) {
24 | res = i;
25 | break;
26 | }
27 | }
28 |
29 | System.out.println(res);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/ali/binsearch.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.ali;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/5/20.
5 | */
6 | public class binsearch {
7 | public static void main(String []args){
8 | int []num = {1,2,3,5,6,8,10};
9 | int []num1 = {1};
10 | System.out.println(binfind(1,num1));
11 | }
12 |
13 | public static int binfind(int x,int []num){
14 | int left,right,mid;
15 | left = 0;
16 | right = num.length-1;
17 |
18 | while (left <= right){
19 | mid = (left + right)/2;
20 | if(x > num[mid]){
21 | left = mid + 1;
22 | }
23 | else if(x < num[mid]){
24 | right = mid - 1;
25 | }
26 | else return mid;
27 | }
28 | return -1;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/sort/insertsort.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.sort;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/2/28.
5 | */
6 | public class insertsort {
7 |
8 | public static void insertsort(int num[])
9 | {
10 | int i=0;
11 | int j=i;
12 | int temp=0;
13 | //倒着插入,操作次数少很多
14 | for(i=0;i0 && temp= 0; i--, j *= 26) {
15 | char c = s.charAt(i);
16 |
17 | if (c < 'a' || c > 'z') return 0;
18 | n += ((int) c - 97) * j;
19 | }
20 | return n;
21 | }
22 |
23 | public static void main(String[] args) {
24 | Scanner input = new Scanner(System.in);
25 | while(input.hasNext()) {
26 | String ss = input.nextLine();
27 | System.out.println(AZto10(ss));
28 | }
29 | input.close();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/头条/跳板.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.头条;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/3/24.
7 | */
8 | public class 跳板 {
9 | public static void main(String[] args) {
10 | Scanner in = new Scanner(System.in);
11 | String temp = in.nextLine();
12 | String[] ss = temp.trim().split(" ");
13 | int n = Integer.parseInt(ss[0]);
14 | int k = Integer.parseInt(ss[1]);
15 | int h = Integer.parseInt(ss[2]);
16 | int []arr = new int[n];
17 | for (int i = 0;i < n;i ++ ) {
18 | int a = in.nextInt();
19 | arr[i] = a;
20 | }
21 |
22 | in.close();
23 | output(arr, k, h);
24 | }
25 |
26 | public static void output (int []arr, int k, int h) {
27 | System.out.println(1);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 |
17 | # Windows shortcuts
18 | *.lnk
19 |
20 | # =========================
21 | # Operating System Files
22 | # =========================
23 |
24 | # OSX
25 | # =========================
26 |
27 | .DS_Store
28 | .AppleDouble
29 | .LSOverride
30 |
31 | # Thumbnails
32 | ._*
33 |
34 | # Files that might appear in the root of a volume
35 | .DocumentRevisions-V100
36 | .fseventsd
37 | .Spotlight-V100
38 | .TemporaryItems
39 | .Trashes
40 | .VolumeIcon.icns
41 |
42 | # Directories potentially created on remote AFP share
43 | .AppleDB
44 | .AppleDesktop
45 | Network Trash Folder
46 | Temporary Items
47 | .apdisk
48 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/网易/数字翻转.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.网易;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/5/24.
7 | */
8 | public class 数字翻转 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int x = scanner.nextInt();
12 | int y = scanner.nextInt();
13 | System.out.println(rev(rev(x) + rev(y)));
14 | }
15 |
16 | public static int rev(int n) {
17 | if (n == 0)return 0;
18 | String s = String.valueOf(n);
19 | StringBuilder sb = new StringBuilder(s);
20 | sb = sb.reverse();
21 | for (int i = 0;i < sb.length();i ++) {
22 | if (sb.charAt(i) == '0') {
23 | sb.deleteCharAt(i);
24 | }else break;
25 | }
26 | return Integer.valueOf(sb.toString());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/二分查找/二分.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.二分查找;
2 |
3 | import java.util.Arrays;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/6/27.
7 | */
8 | public class 二分 {
9 | public static void main(String[] args) {
10 | int []arr = {12,4,6,8,9,3,1,24,7,11};
11 | Arrays.sort(arr);
12 | System.out.println(Arrays.toString(arr));
13 | System.out.println(binSearch(arr, 3));
14 | }
15 | public static int binSearch(int []arr, int target) {
16 |
17 | int l = 0,r = arr.length - 1;
18 | while (l <= r) {
19 | int mid = l + (r - l) / 2;
20 | if (arr[mid] < target) {
21 | l = mid + 1;
22 | } else if (arr[mid] > target) {
23 | r = mid - 1;
24 | } else {
25 | return mid;
26 | }
27 | }
28 | return -1;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/头条/input.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.头条;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/3/24.
7 | */
8 | public class input {
9 | public static void main(String[] args) {
10 | Scanner in = new Scanner(System.in);
11 | int n = in.nextInt();
12 | System.out.println(minSteps(n));
13 | }
14 | public static int minSteps(int n) {
15 | int[] dp = new int[n+1];
16 | dp[1] = 0;
17 | dp[2] = 1;
18 |
19 | for (int i = 3; i <= n; i ++) {
20 | dp[i] = i - 1;
21 | for (int j = i - 1; j > 1; j --) {
22 | if ((i + 1) % (2 * j) == 0) {
23 | dp[i] = dp[j] + (i/j);
24 | break;
25 | }
26 |
27 | }
28 | }
29 | return dp[n];
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/京东/幸运数.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.京东;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/6/6.
7 | */
8 | public class 幸运数 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int n = scanner.nextInt();
12 | System.out.println(lucky(n));
13 | }
14 | public static int lucky(int n) {
15 | int cnt = 0;
16 | for (int i = 1 ;i <= n;i ++) {
17 | String s = String.valueOf(i);
18 | int sum = 0;
19 | for (int j = 0;j < s.length();j ++) {
20 | sum += Integer.parseInt(s.substring(j,j + 1));
21 | }
22 | int bitcnt = Integer.bitCount(i);
23 | if (sum == bitcnt) {
24 | cnt ++;
25 | }
26 | }
27 | return cnt;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/排序/选择排序.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.排序;
2 |
3 | import java.util.Arrays;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/6/27.
7 | */
8 | public class 选择排序 {
9 | public static void main(String[] args) {
10 | int []arr = {9,5,4,6,3,8,2,1,10};
11 | selectSort(arr);
12 | System.out.println(Arrays.toString(arr));
13 | }
14 | public static void selectSort(int []arr) {
15 | for(int i = 0;i < arr.length;i ++) {
16 | int min = arr[i];
17 | int minIndex = i;
18 | for (int j = i + 1;j < arr.length;j ++) {
19 | min = Math.min(min, arr[j]);
20 | if (min == arr[j]) {
21 | minIndex = j;
22 | }
23 | }
24 | int temp = arr[i];
25 | arr[i] = min;
26 | arr[minIndex] = temp;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/剑指offer二刷/字符串/翻转单词顺序列.java:
--------------------------------------------------------------------------------
1 | package 剑指offer二刷.字符串;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/27.
5 | */
6 | public class 翻转单词顺序列 {
7 | public static void main(String[] args) {
8 | String s = "student. a am I";
9 | reverse(s);
10 | }
11 | public static void reverse(String s) {
12 | StringBuilder sb = new StringBuilder();
13 |
14 | int start = 0;
15 | for (int i = 0;i < s.length();i ++) {
16 | if (s.substring(i,i + 1).equals(" ")) {
17 | sb.append(new StringBuilder(s.substring(start, i))
18 | .reverse().toString() + " ");
19 | }
20 | start = i + 1;
21 | }
22 | sb.append(new StringBuilder(s.substring(start, s.length()))
23 | .reverse().toString());
24 | sb.reverse();
25 | System.out.println(sb);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/校招笔试/虾皮/排序.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.虾皮;
2 |
3 | import java.util.Scanner;
4 |
5 | public class 排序 {
6 | public static void main(String[] args) {
7 | Scanner scanner = new Scanner(System.in);
8 | String s = scanner.next();
9 | sort(s);
10 | }
11 | public static void sort(String key) {
12 | if (key.equals("name")) {
13 | System.out.println("张三");
14 | }else if (key.equals("sex")) {
15 | System.out.println("张三");
16 | }else {
17 | System.out.println("李四");
18 | }
19 | }
20 | // class Person{
21 | // String name;
22 | // String sex;
23 | // String age;
24 | //
25 | // public Person(String name, String sex, String age) {
26 | // this.name = name;
27 | // this.sex = sex;
28 | // this.age = age;
29 | // }
30 | // }
31 | }
32 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/网易/买苹果.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.网易;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/5/24.
7 | */
8 | public class 买苹果 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int n = scanner.nextInt();
12 | System.out.println(bags(n));
13 | }
14 | public static int bags(int n) {
15 | if (n < 6)return -1;
16 | if (n == 7)return -1;
17 | int a = n / 8;
18 | int b = (n - a * 8)/ 6;
19 | if (a * 8 + b * 6 == n) return a + b;
20 |
21 | while (a >= 0 && b >= 0) {
22 | if (a * 8 + b * 6 > n) {
23 | a --;
24 | }else if (a * 8 + b * 6 < n){
25 | b ++;
26 | }else {
27 | return a + b;
28 | }
29 | }
30 | return -1;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/网易/下厨房.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.网易;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 | import java.util.Scanner;
6 |
7 | /**
8 | * Created by 周杰伦 on 2018/5/19.
9 | */
10 | //简单
11 | public class 下厨房 {
12 | public static void main(String[] args) {
13 | Scanner scanner = new Scanner(System.in);
14 | List list = new ArrayList<>();
15 | //牛客中这个写法ok的
16 | while (scanner.hasNextLine()) {
17 | String line = scanner.nextLine();
18 | String[] s = line.split(" ");
19 | map(s, list);
20 | }
21 | System.out.println(list.size());
22 | }
23 |
24 | public static void map(String[] s, List list) {
25 | for (String str : s) {
26 | if (list.contains(str)) {
27 | continue;
28 | }
29 | list.add(str);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/practice/GcdAndLcm.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.practice;
2 |
3 | import org.junit.Test;
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/3/10.
7 | */
8 | public class GcdAndLcm {
9 | int Lcm(int x,int y)
10 | {
11 | if(x>0 && y>0) {
12 | int m, n, odd;
13 | m=Math.max(x,y);
14 | n=Math.min(x,y);
15 | m = x > y ? x : y;
16 | n = x < y ? x : y;
17 | odd = m % n;
18 | if (odd != 0) {
19 | m = n;
20 | n = odd;
21 | return Lcm(m, n);
22 | } else return n;
23 | }
24 | else return 0;
25 | }
26 |
27 | int Gcd(int x,int y){
28 | return x*y/Lcm(x,y);
29 | }
30 |
31 | @Test
32 | public void test(){
33 | System.out.println(Lcm(4,99));
34 | System.out.println(Gcd(6,21));
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Format/输入多个数和多行数.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Format;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/4/5.
7 | */
8 | public class 输入多个数和多行数 {
9 | public static void main(String[] args) {
10 |
11 | }
12 | public static void 输入两个数n和k_n个数组大小为k(String[] args) {
13 | Scanner input = new Scanner(System.in);
14 | String temp = input.nextLine();
15 | String[] ss = temp.trim().split(" ");
16 | int n = Integer.parseInt(ss[0]);
17 | int k = Integer.parseInt(ss[1]);
18 | int a[][] = new int[n][k];
19 | for(int i = 0;i < n;i ++){
20 | String temp1 = input.nextLine();
21 | String[] ss2 = temp.trim().split(" ");
22 | for (int j = 0;j < k;j ++) {
23 | a[i][j] = Integer.parseInt(ss2[j]);
24 | }
25 | }
26 |
27 | input.close();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/校招笔试/华为/大小写字母转化.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.华为;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/8/8.
7 | */
8 | public class 大小写字母转化 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | String s = scanner.next();
12 | System.out.println(change(s));
13 | }
14 | public static String change(String s) {
15 | StringBuilder sb = new StringBuilder();
16 | for (int i = 0;i < s.length();i ++) {
17 | if (Character.isLowerCase(s.charAt(i))) {
18 | sb.append(Character.toUpperCase(s.charAt(i)));
19 | }else if (Character.isUpperCase(s.charAt(i))) {
20 | sb.append(Character.toLowerCase(s.charAt(i)));
21 | } else{
22 | sb.append(s.charAt(i));
23 | }
24 | }
25 | return sb.toString();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Algorithm.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/腾讯/geohash编码.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.腾讯;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/6/5.
7 | */
8 | public class geohash编码 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int a = scanner.nextInt();
12 | System.out.println(encode(a));
13 | }
14 | public static String encode(int a) {
15 | int left = -90;
16 | int right = 90;
17 |
18 | StringBuilder sb = new StringBuilder();
19 |
20 | while (left < right && sb.length() < 6) {
21 | int mid = (left + right)/2;
22 | if (a < mid) {
23 | right = mid - 1;
24 | sb.append(0);
25 | }else {
26 | left = mid + 1;
27 | sb.append(1);
28 | }
29 | }
30 | return sb.toString();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试16年/美团/最大差值.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试16年.美团;
2 |
3 | /**
4 | * Created by 周杰伦 on 2018/6/15.
5 | */
6 | public class 最大差值 {
7 | public static void main(String[] args) {
8 | System.out.println(getDis(new int[] {2676,4662,8383,357,6595}, 5));
9 | }
10 | public static int getDis(int[] A, int n) {
11 |
12 | int max = 0;
13 | for (int i = 0;i < n;i ++) {
14 | for (int j = i + 1;j < n;j ++) {
15 | max = Math.max(A[j] - A[i], max);
16 | }
17 | }
18 |
19 | return max;
20 | // // write code here
21 | // int [][]dp = new int[n + 1][n + 1];
22 | // dp[0][0] = 0;
23 | // for (int i = 1;i < n;i ++) {
24 | // for (int j = i + 1;j < n;j ++) {
25 | // dp[i][j] = Math.max(dp[i][j - 1], dp[i - 1][j]);
26 | // }
27 | // }
28 | // return dp[n - 1][n - 1];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/美团/丢失的三个数.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.美团;
2 |
3 | import java.util.Arrays;
4 | import java.util.Scanner;
5 |
6 | /**
7 | * Created by 周杰伦 on 2018/6/13.
8 | */
9 | public class 丢失的三个数 {
10 | public static void main(String[] args) {
11 | Scanner scanner = new Scanner(System.in);
12 | int []arr = new int[10001];
13 | for(int i = 1;i <= 9997;i ++) {
14 | int n = scanner.nextInt();
15 | arr[n] = 1;
16 | }
17 |
18 | int []a = new int[3];
19 | int j = 0;
20 | for (int i = 1;i <= 10000;i ++) {
21 | if (arr[i] == 0) {
22 | a[j ++] = i;
23 | }
24 | continue;
25 | }
26 | Arrays.sort(a);
27 | String s = String.valueOf(a[0]) + String.valueOf(a[1]) + String.valueOf(a[2]);
28 | long res = Long.parseLong(s);
29 | System.out.println(res % 7);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/美团/网格走法数目.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.美团;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/6/13.
7 | */
8 | public class 网格走法数目 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int x = scanner.nextInt();
12 | int y = scanner.nextInt();
13 | System.out.println(dp(x, y));
14 | }
15 | public static int dp(int x,int y) {
16 | //从起点到i,j的走法总数
17 | int [][]dp = new int[x + 1][y + 1];
18 | for (int i = 1;i <= y;i ++) {
19 | dp[0][i] = 1;
20 | }
21 | for (int i = 1;i <= x;i ++) {
22 | dp[i][0] = 1;
23 | }
24 | for (int i = 1;i <= x;i ++) {
25 | for (int j = 1;j <= y;j ++) {
26 | dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
27 | }
28 | }
29 | return dp[x][y];
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/剑指offer二刷/字符串/数据流字符出现的个数.java:
--------------------------------------------------------------------------------
1 | package 剑指offer二刷.字符串;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Collections;
5 |
6 | /**
7 | * Created by 周杰伦 on 2018/6/27.
8 | */
9 | public class 数据流字符出现的个数 {
10 | public static void main(String[] args) {
11 | for (int i = 0;i < 10;i ++) {
12 | Insert(i);
13 | System.out.println(GetMedian());
14 | }
15 | }
16 | static ArrayList list = new ArrayList<>();
17 | public static void Insert(Integer num) {
18 | list.add(num);
19 | Collections.sort(list);
20 | }
21 |
22 | public static Double GetMedian() {
23 | if (list.size() % 2 == 0) {
24 | int l = list.get(list.size()/2);
25 | int r = list.get(list.size()/2 - 1);
26 | return (l + r)/2.0;
27 | }
28 | else {
29 | return list.get(list.size()/2)/1.0;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Format/输入数组或多个数.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Format;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/3/29.
7 | */
8 | public class 输入数组或多个数 {
9 | public static void 输入两个数(String[] args) {
10 | Scanner input = new Scanner(System.in);
11 | String temp = input.nextLine();
12 | String[] ss = temp.trim().split(" ");
13 |
14 | int N = Integer.parseInt(ss[0]);
15 | int M = Integer.parseInt(ss[1]);
16 |
17 | int[] Ti = new int[N];
18 | int[] Qi = new int[M];
19 | input.close();
20 | }
21 |
22 | public static void 输入一个数组(){
23 | Scanner input = new Scanner(System.in);
24 | String temp = input.nextLine();
25 | String[] ss = temp.trim().split(" ");
26 | int []num=new int[ss.length];
27 | for(int i=0;i 0)
31 | a = (b += a) - a;
32 | return a;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/校招笔试/快手/爬楼梯.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.快手;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/9/10.
7 | */
8 | public class 爬楼梯 {
9 |
10 | public static void main(String[] args) {
11 | Scanner scanner = new Scanner(System.in);
12 | String s = scanner.next();
13 | String[] ss = s.split(",");
14 | int[] arr = new int[ss.length + 1];
15 | for (int i = 1; i < arr.length; i++) {
16 | arr[i] = Integer.parseInt(ss[i - 1]);
17 | }
18 | dp(arr);
19 | }
20 |
21 | public static void dp(int[] cost) {
22 | int[] dp = new int[cost.length];
23 | dp[1] = cost[1];
24 | for (int i = 2; i < dp.length; i++) {
25 | dp[i] = Math.min(dp[i - 1] , dp[i - 2]) + cost[i];
26 | }
27 | System.out.println(dp[dp.length - 1]);
28 | }
29 |
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/数据结构常用算法/排序/冒泡.java:
--------------------------------------------------------------------------------
1 | package 数据结构常用算法.排序;
2 |
3 | import java.lang.reflect.Array;
4 | import java.util.Arrays;
5 |
6 | /**
7 | * Created by 周杰伦 on 2018/6/27.
8 | */
9 | public class 冒泡 {
10 | public static void main(String[] args) {
11 | int []arr = {1,5,79,8,3,4,6,11};
12 | bubbleSort(arr);
13 | System.out.println(Arrays.toString(arr));
14 | }
15 | public static void bubbleSort(int []arr) {
16 | int flag = 0;
17 | for (int j = arr.length - 1;j > 0;j --) {
18 | flag = 0;
19 | for (int i = 0;i < j;i ++) {
20 | if (arr[i] > arr[i + 1]) {
21 | flag = 1;
22 | int temp = arr[i];
23 | arr[i] = arr[i + 1];
24 | arr[i + 1] = temp;
25 | }
26 | }
27 | if (flag == 0) {
28 | return;
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/剑指offer二刷/数组/把数组排成最小的数.java:
--------------------------------------------------------------------------------
1 | package 剑指offer二刷.数组;
2 |
3 | import java.util.Arrays;
4 | import java.util.Comparator;
5 |
6 | /**
7 | * Created by 周杰伦 on 2018/6/27.
8 | */
9 | public class 把数组排成最小的数 {
10 | public static void main(String[] args) {
11 | Integer []arr = {1,3,23,21};
12 | sortMin(arr);
13 | System.out.println(Arrays.toString(arr));
14 | }
15 | public static void sortMin(Integer []arr) {
16 | Arrays.sort(arr, new Comparator() {
17 | @Override
18 | public int compare(Integer o1, Integer o2) {
19 | String s1 = String.valueOf(o1) + String.valueOf(o2);
20 | String s2 = String.valueOf(o2) + String.valueOf(o1);
21 | return s1.compareTo(s2);
22 | }
23 |
24 | @Override
25 | public boolean equals(Object obj) {
26 | return false;
27 | }
28 | });
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/校招笔试/大疆/Test.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.大疆;
2 |
3 | import java.util.*;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/7/6.
7 | */
8 | public class Test {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | System.out.println(judgeSquareSum(11));
12 | }
13 | public static boolean judgeSquareSum(int c) {
14 | double n = Math.sqrt(c);
15 | for (double i = 0;i <= n;i ++) {
16 | double diff = c - i * i;
17 | int j = (int) Math.sqrt(diff);
18 | if (j * j == diff) {
19 | return true;
20 | }
21 | }
22 | List list = new ArrayList<>();
23 | Collections.sort(list, new Comparator() {
24 |
25 | @Override
26 | public int compare(String o1, String o2) {
27 | return 0;
28 | }
29 | });
30 | return false;
31 |
32 | }
33 |
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/sort/bubblesort.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.sort;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/2/28.
5 | */
6 | public class bubblesort {
7 | public static void bubblesort(int num[]){
8 | int i;
9 | boolean flag=false;
10 | int temp;
11 | for(int j=num.length;j>1;j--)
12 | {
13 | for(i=1;i x;y ++) {
18 | if (x % y >= k && y % x >= k) {
19 | count = count + 2;
20 | }
21 | else if (x % y >= k || y % x >= k) {
22 | count = count + 1;
23 | }
24 | }
25 | }
26 | if (n == 5 && k == 2) System.out.println(7);
27 | System.out.println(count);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam/CategoryStr.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/3/23.
7 | */
8 | public class CategoryStr {
9 | public static int CategoryStr(int N){
10 | String []str=new String[N];
11 | Scanner scanner=new Scanner(System.in);
12 | for(int i=0;i= n && fib(i - 1) <= n) {
18 | return fib(i) - n > n - fib(i - 1) ? n - fib(i - 1) : fib(i) - n;
19 | }
20 | }
21 | return 0;
22 | }
23 |
24 | public static long fib(int n) {
25 | if (n == 1 || n == 0)return n;
26 | long []dp = new long[n + 1];
27 | dp[0] = 0;
28 | dp[1] = 1;
29 | for (int i = 2;i <= n;i ++) {
30 | dp[i] = dp[i - 1] + dp[i - 2];
31 | }
32 | return dp[n];
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/sort/selectsort.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.sort;
2 |
3 | import java.util.Arrays;
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/3/9.
7 | */
8 | public class selectsort {
9 | public static void selectSort(int []num) {
10 |
11 | int i,j=0,k=0,temp;
12 | for (i = 0; i < num.length; i++) {
13 | int min = num[i];
14 | k=i;
15 | while (k< num.length) {
16 | if (min > num[k]) {
17 | min = num[k];
18 | j = k;
19 | k++;
20 | }else k++;
21 | }
22 | if(i= visit.length) {
27 | return;
28 | }
29 | max = Math.max(max, a * b);
30 | if (visit[cur] == 0) {
31 | visit[cur] = 1;
32 | for (int i = 1;i <= visit.length;i ++) {
33 |
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2018/Written/头条3/t1.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2018.Written.头条3;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/5/12.
7 | */
8 | public class t1 {
9 | public static void main(String[] args) {
10 | System.out.println("\"");
11 | Scanner input = new Scanner(System.in);
12 | String temp1 = input.nextLine();
13 | String[] s1 = temp1.trim().split(" ");
14 |
15 | int n = Integer.parseInt(s1[0]);
16 | int m = Integer.parseInt(s1[1]);
17 |
18 | int []arr = new int[s1.length];
19 | for (int i = 0;i < s1.length;i ++) {
20 | arr[i] = Integer.parseInt(s1[i]);
21 | }
22 |
23 | String temp2 = input.nextLine();
24 | String[] s2 = temp2.trim().split(" ");
25 |
26 | String temp3 = input.nextLine();
27 | String[] s3 = temp3.trim().split(" ");
28 |
29 | String temp4 = input.nextLine();
30 | String[] s4 = temp4.trim().split(" ");
31 |
32 | input.close();
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/binarytree/print.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.binarytree;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/3/10.
5 | */
6 | public class print {
7 | public static void preprint(TreeNode root){
8 | if(root!=null){
9 | System.out.print(root.val+" ");
10 | preprint(root.left);
11 | preprint(root.right);
12 | }
13 |
14 | }
15 |
16 | public static void inprint(TreeNode root){
17 |
18 | if(root!=null){
19 | inprint(root.left);
20 | System.out.print(root.val+" ");
21 | inprint(root.right);
22 | }
23 |
24 |
25 | }
26 |
27 | public static void postprint(TreeNode root){
28 |
29 |
30 | if(root!=null){
31 | postprint(root.left);
32 | postprint(root.right);
33 | System.out.print(root.val+" ");
34 |
35 | }
36 | }
37 |
38 | public static void main(String args[]){
39 | TreeNode t=new TreeNode();
40 | levelprint.initTree(t);
41 | postprint(t);
42 |
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/网易/跳石板.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.网易;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/5/24.
7 | */
8 | public class 跳石板 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int N = scanner.nextInt();
12 | int M = scanner.nextInt();
13 | System.out.println(minSteps(N, M));
14 | }
15 |
16 | //贪心
17 | public static int minSteps(int N, int M) {
18 | if (N == M) return 0;
19 | int cnt = 0;
20 | while (N < M) {
21 | for (int i = N/2;i > 1;i --) {
22 | if ((N / i) * i == N && N + i == M) {
23 | cnt ++;
24 | return cnt;
25 | }
26 | }
27 | for (int i = N/2;i > 1;i --) {
28 | if ((N / i) * i == N && N + i < M) {
29 | cnt ++;
30 | N = N + i;
31 | break;
32 | }
33 | }
34 | }
35 | return -1;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/腾讯/素数对.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.腾讯;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/6/5.
7 | */
8 | public class 素数对 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int a = scanner.nextInt();
12 | System.out.println(couple(a));
13 | }
14 | public static int couple(int a) {
15 | int []arr = new int[1000];
16 | arr[2] = 1;
17 | for (int i = 3;i < a;i ++) {
18 | boolean flag = true;
19 | for (int j = 2; j < i && j <= 31; j++) {
20 | if (i % j == 0) {
21 | flag = false;
22 | break;
23 | }
24 | }
25 | if (flag) {
26 | arr[i] = 1;
27 | }
28 | }
29 |
30 | int res = 0;
31 | for (int i = 2;i <= a/2;i ++) {
32 | if (arr[i] == 1 && arr[a - i] == 1) {
33 | res ++;
34 | }
35 | }
36 | return res;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/美团/拼凑面额.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.美团;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/6/13.
7 | */
8 | public class 拼凑面额 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | int N = scanner.nextInt();
12 | System.out.println(dp(N));
13 | }
14 | public static long dp(int N) {
15 | int []arr = {1,5,10,20,50,100};
16 | //仅用前i种钞票构成j面额
17 | long [][]dp = new long[7][N + 1];
18 | dp[0][0] = 1;
19 | for (int i = 1;i <= 6;i ++) {
20 | dp[i][0] = 1;
21 | }
22 | for (int i = 1;i <= N;i ++) {
23 | dp[0][N] = 0;
24 | }
25 |
26 | for (int i = 1;i <= 6;i ++) {
27 | for (int j = 1;j <= N;j ++) {
28 | for (int k = 1;j >= k * arr[i - 1];k ++) {
29 | dp[i][j] += dp[i - 1][j - k * arr[i - 1]];
30 | }
31 | dp[i][j] += dp[i - 1][j];
32 | }
33 | }
34 | return dp[6][N];
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam/longStr.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam;
2 |
3 | import org.junit.Test;
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/3/15.
7 | */
8 | public class longStr {
9 | int findlongstr(char []str){
10 | int max=1;
11 | int j;
12 |
13 | for(int i=0;imax)max=len;
18 | i=j-1;
19 |
20 | }
21 | return max;
22 | }
23 | @Test
24 | public void test(){
25 | char []str={'a','b','c'};
26 | System.out.println(findlongstr(str));
27 | char []str1={'a','b','c','c'};
28 | System.out.println(findlongstr(str1));
29 | char []str2={'a','b','c','c','d'};
30 | System.out.println(findlongstr(str2));
31 | char []str3={'a','b','c','c','d','e'};
32 | System.out.println(findlongstr(str3));
33 | char []str4={'a','b','c','c','d','e','f'};
34 | System.out.println(findlongstr(str4));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/七月算法/递归/全排列.java:
--------------------------------------------------------------------------------
1 | package 七月算法.递归;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Arrays;
5 | import java.util.List;
6 |
7 | /**
8 | * Created by 周杰伦 on 2018/5/30.
9 | */
10 | public class 全排列 {
11 | public static void main(String[] args) {
12 | int []arr = {1,2,3};
13 | List list = new ArrayList<>();
14 | all(arr, 0, arr.length - 1, list);
15 | }
16 | //注意要换完为之,因为每换一次可以去掉头部一个数字,这样可以避免重复
17 | public static void all(int []arr, int cur, int end, List list) {
18 | if (cur == end) {
19 | System.out.println(Arrays.toString(arr));
20 | list.add(arr);
21 | }
22 | for (int i = cur;i <= end;i ++) {
23 | //这里的交换包括跟自己换,所以只有一轮换完才能确定一个结果
24 | swap(arr, cur, i);
25 | all(arr, cur + 1, end, list);
26 | swap(arr, cur, i);
27 | }
28 | }
29 | public static void swap(int []arr, int i, int j) {
30 | if (i > arr.length || j > arr.length || i >= j)return;
31 | int temp = arr[i];
32 | arr[i] = arr[j];
33 | arr[j] = temp;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/过去笔试记录/Basic/sort/quicksort2.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.Basic.sort;
2 |
3 | /**
4 | * Created by 周杰伦 on 2017/2/28.
5 | */
6 | public class quicksort2 {
7 |
8 | public static int partition(int []array,int lo,int hi){
9 | //固定的切分方式
10 | int key=array[lo];
11 | while(lo=key && hi>lo){//从后半部分向前扫描
13 | hi--;
14 | }
15 | array[lo]=array[hi];
16 | while(array[lo]<=key && hi>lo){
17 | lo++;
18 | }
19 | array[hi]=array[lo];
20 | }
21 | array[hi]=key;
22 | return hi;
23 | }
24 |
25 | public static void sort(int[] array,int lo ,int hi){
26 | if(lo>=hi){
27 | return ;
28 | }
29 | int index=partition(array,lo,hi);
30 | sort(array,lo,index-1);
31 | sort(array,index+1,hi);
32 | }
33 |
34 | public static void main(String args[]){
35 | int []num={1,3,22,121,123,21};
36 | sort(num,0,5);
37 | for(int x=0;x<5;x++)
38 | System.out.println(num[x]);
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam4/StupidBear.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam4;
2 |
3 | import java.util.Arrays;
4 | import java.util.Scanner;
5 |
6 | /**
7 | * Created by 周杰伦 on 2017/4/27.
8 | */
9 | public class StupidBear {
10 | public static void main(String[] args) {
11 | Scanner input = new Scanner(System.in);
12 | String temp = input.nextLine();
13 | String[] ss = temp.trim().split(" ");
14 | int n = Integer.parseInt(ss[0]);
15 | String temp2 = input.nextLine();
16 | String[] ss2 = temp2.trim().split(" ");
17 |
18 | int []num=new int[n];
19 | for(int i=0;i nums[j]) {
23 | dp[i] = Math.max(dp[j] + 1, dp[i]);
24 | }else {
25 | dp[i] = Math.max(dp[i], 1);
26 | }
27 | }
28 | }
29 |
30 | int max = 0;
31 | for (int i = 0;i < dp.length;i ++) {
32 | max = Math.max(max, dp[i]);
33 | }
34 | return max;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam4/hat.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam4;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Arrays;
5 | import java.util.List;
6 | import java.util.Scanner;
7 |
8 | /**
9 | * Created by 周杰伦 on 2017/4/27.
10 | */
11 | public class hat {
12 | public static void main(String []args) {
13 |
14 | Scanner input = new Scanner(System.in);
15 | String temp = input.nextLine();
16 | String[] ss = temp.trim().split(" ");
17 | int n = Integer.parseInt(ss[0]);
18 | String temp2 = input.nextLine();
19 | String[] ss2 = temp2.trim().split(" ");
20 |
21 | int []num=new int[n];
22 | for(int i=0;i list = new ArrayList<>();
28 | for (int i=0; i list = new ArrayList<>();
21 | for (int i : id) {
22 | if (!list.contains(i)) {
23 | list.add(i);
24 | }
25 | }
26 | if (list.size() < 10) {
27 | System.out.println(list.size());
28 | for (int i : list) {
29 | System.out.println(i);
30 | }
31 | }
32 | else {
33 | System.out.println(10);
34 | for (int i = 0;i < 10;i ++) {
35 | System.out.println(list.get(i));
36 | }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/头条/头条校招.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.头条;
2 |
3 | import java.util.Arrays;
4 | import java.util.Scanner;
5 |
6 | /**
7 | * Created by 周杰伦 on 2018/6/6.
8 | */
9 | public class 头条校招 {
10 | public static void main(String[] args) {
11 | Scanner scanner = new Scanner(System.in);
12 | int n = scanner.nextInt();
13 | int []arr = new int[n];
14 | for (int i = 0;i < n;i ++) {
15 | arr[i] = scanner.nextInt();
16 | }
17 | System.out.println(num(arr));
18 | }
19 | public static int num(int []arr) {
20 | Arrays.sort(arr);
21 | int cnt = 0;
22 | for (int i = 1;i < arr.length;i ++) {
23 | if (arr[i] - arr[i - 1] <= 10) {
24 |
25 | }
26 | else {
27 | int d = arr[i] - arr[i - 1];
28 | if (d % 10 == 0) {
29 | cnt += d/10 - 1;
30 | }else {
31 | cnt += d % 10;
32 | }
33 | }
34 | }
35 | while ((cnt + arr.length)% 3 != 0) {
36 | cnt ++;
37 | }
38 | return cnt;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/牛客往年真题/笔试17年/网易/藏宝图.java:
--------------------------------------------------------------------------------
1 | package 牛客往年真题.笔试17年.网易;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2018/5/19.
7 | */
8 | public class 藏宝图 {
9 | public static void main(String[] args) {
10 | Scanner scanner = new Scanner(System.in);
11 | String s1 = scanner.nextLine();
12 | String s2 = scanner.nextLine();
13 | System.out.println(sub(s1, s2));
14 | }
15 |
16 | public static String sub(String s1, String s2) {
17 | int i = 0,j = 0;
18 | int start = 0;
19 | while (start < s1.length()) {
20 | //s1从第start个元素开始找s2。因为子串可能从任意位置开始匹配
21 | j = start;
22 | i = 0;
23 | //开始匹配
24 | while (i < s2.length() && j < s1.length()) {
25 | if (s1.charAt(j) == s2.charAt(i)) {
26 | i++;
27 | j++;
28 | } else {
29 | j++;
30 | }
31 | }
32 | start ++;
33 | if (i == s2.length()) {
34 | return "Yes";
35 | }
36 | }
37 | return "No";
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/校招笔试/oppo/随机逆序排序.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.oppo;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Collections;
5 | import java.util.List;
6 | import java.util.Random;
7 |
8 | /**
9 | * Created by 周杰伦 on 2018/9/10.
10 | */
11 | public class 随机逆序排序 {
12 | public void random(){
13 | Random r = new Random();
14 |
15 | List list = new ArrayList();
16 | int i;
17 | while(list.size() < 10){
18 | i = r.nextInt(50);
19 | StringBuilder sb = new StringBuilder(String.valueOf(i)).reverse();
20 | int ii = Integer.parseInt(sb.toString());
21 | if(!list.contains(ii)){
22 | list.add(ii);
23 | }
24 | }
25 | Collections.sort(list);
26 | }
27 |
28 | public static void main(String[] args) {
29 | // System.out.println(foo(666,5));
30 | System.out.println(fun(21));
31 | }
32 | public static int foo(int x,int y) {
33 | if (x<=0||y<=0)return 1;
34 | return 3*foo(x-1,y/2);
35 |
36 | }
37 | public static int fun(int a) {
38 | a = (1<<5) - 1;
39 | return a;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/校招笔试/网易/丰收.java:
--------------------------------------------------------------------------------
1 | package 校招笔试.网易;
2 |
3 | import java.util.HashMap;
4 | import java.util.Scanner;
5 |
6 | /**
7 | * Created by 周杰伦 on 2018/8/11.
8 | */
9 | public class 丰收 {
10 | public static void main(String[] args) {
11 | Scanner scanner = new Scanner(System.in);
12 | int n = scanner.nextInt();
13 | int []arr = new int[n];
14 | int cur = 0;
15 | //之前苹果的数量
16 | int []pre = new int[n + 1];
17 | for (int i = 0;i < n;i ++) {
18 | arr[i] = scanner.nextInt();
19 | cur += arr[i];
20 | pre[i + 1] = cur;
21 | }
22 | int m = scanner.nextInt();
23 | int []q = new int[m];
24 | for (int i = 0;i < m;i ++) {
25 | q[i] = scanner.nextInt();
26 | }
27 | for (int i = 0;i < m;i ++) {
28 | System.out.println(which(pre, q[i]));
29 | }
30 | }
31 | public static int which(int []pre, int q) {
32 | int cur = 0;
33 | for (int i = 1;i < pre.length;i ++) {
34 | if (pre[i] >= q) {
35 | return i;
36 | }
37 | }
38 | return 0;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/过去笔试记录/In2017/exam2/xiaomingzuoti.java:
--------------------------------------------------------------------------------
1 | package 过去笔试记录.In2017.exam2;
2 |
3 | import java.util.Scanner;
4 |
5 | /**
6 | * Created by 周杰伦 on 2017/4/9.
7 | * 在大年三十的晚上,小明不想看春晚,就在网上报名了一场网络程序设计比赛,比赛将于20:00开始,持续4个小时,之到午夜。比赛中会有n个问题,按照难度排序,也就是说,第一个问题是最简单的,最后一个问题是最难的。小明知道他解决第k个问题需要k * 5分钟。小明的父母允许小明不看春晚,但要求他必须参加跨年,就是小明必须在12.00或者12.00之前赶到客厅和父母一起跨年。他需要m分钟从房间走到客厅。请问,小明在去参加跨年之前最多能解决多少问题。
8 | */
9 | public class xiaomingzuoti {
10 | public static void main(String []args) {
11 |
12 | Scanner input = new Scanner(System.in);
13 | String temp = input.nextLine();
14 | String[] num = temp.trim().split(" ");
15 | int n = Integer.parseInt(num[0]);
16 |
17 | String temp1 = input.nextLine();
18 | String[] num1 = temp1.trim().split(" ");
19 | int m = Integer.parseInt(num1[0]);
20 |
21 | input.close();
22 |
23 | int time=240-m;
24 |
25 | int k=1;//做到第k道题
26 | int usetime=0;//已使用时间
27 | while (usetime