- 博客(12)
- 收藏
- 关注
原创 面试题14- II. 剪绳子 II
import java.math.BigInteger;class Solution { public int cuttingRope(int n) { if(n <= 1) return 0; if(n == 2) return 1; if(n == 3) ...
2020-02-20 15:35:07
151
原创 面试题14- I. 剪绳子
class Solution { public int cuttingRope(int n) { if (n <= 1) { return 0; } if (n == 2) { return 1; } if (n == 3) { r...
2020-02-20 15:30:54
128
原创 面试题11. 旋转数组的最小数字
class Solution { public int minArray(int[] numbers) { if (numbers == null || numbers.length == 0) { return 0; } int left = 0; int right = numbers.leng...
2020-02-20 15:27:37
64
原创 面试题10- II. 青蛙跳台阶问题
class Solution { public int numWays(int n) { if (n <= 1) { return 1; } if (n == 2) { return 2; } long first = 1; long s...
2020-02-20 15:26:14
118
原创 面试题10- I. 斐波那契数列
class Solution { public int fib(int n) { if ( n <= 1) { return n; } long first = 0; long second = 1; for (int i = 2; i <= n; i++) { ...
2020-02-20 15:24:35
175
原创 面试题09. 用两个栈实现队列
class CQueue { public Stack<Integer> stack1; public Stack<Integer> stack2; public CQueue() { stack1 = new Stack<Integer>(); stack2 = new Stack<Integ...
2020-02-20 15:23:14
116
原创 面试题06. 从尾到头打印链表
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */class Solution { public int[] reversePrint(...
2020-02-20 15:19:37
82
原创 面试题05. 替换空格
class Solution { public String replaceSpace(String s) { if (s == null) { return null; } StringBuffer sb = new StringBuffer(); for (int i = 0; i < s...
2020-02-20 15:18:09
41
原创 面试题04. 二维数组中的查找
class Solution { public boolean findNumberIn2DArray(int[][] matrix, int target) { if (matrix == null || matrix.length == 0) { return false; } int row = 0; ...
2020-02-20 15:16:26
75
原创 面试题03. 数组中重复的数字
class Solution { public int findRepeatNumber(int[] nums) { if (nums == null || nums.length == 0) { return 0; } int[] temp = new int[nums.length]; for (...
2020-02-20 15:12:25
55
转载 mysql索引详细描述与应用场景
索引的数据结构:(1)一般是B+tree:MySql使用最频繁的一个索引数据结构,数据结构以平衡树的形式来组织,因为是树型结构,所以更适合用来处理排序,范围查找等功能.(2)Hash:Hsah索引在MySql比较少用,他以把数据的索引以Hash形式组织起来,因此当查找某一条记录的时候,速度非常快。对比: 相对Hash索引,B+树在查找单条记录的速度虽然比不上Has...
2019-12-10 20:10:14
102
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人