qzjs
qzjs
全部文章
未归档
LeetCode(3)
剑指offer(Java实现)(38)
华为机试(1)
基础知识及算法(2)
牛客网(华为机试)(1)
纠删码(1)
归档
标签
去牛客网
登录
/
注册
永不止步
全部文章
/ 未归档
(共42篇)
剑指offer(35)数组中的逆序对
//思路与归并排序相似 public class Solution { public int InversePairs(int [] array) { if(array == null || array.length == 0){ return 0;...
2019-04-08
0
320
剑指offer(32)把数组排成最小的数
输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个。例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323。 import java.util.ArrayList; import java.util.Collections;...
2019-04-03
0
464
剑指offer(27)字符串的排列
import java.util.ArrayList; import java.util.Collections; public class Solution { public ArrayList<String> Permutation(String str) { ...
2019-04-01
0
394
剑指offer(23)二叉搜索树的后序遍历序列
public class Solution { //二叉搜索树的后续遍历 //后序排序:数组的最后一个节点为头节点 //搜索二叉树:左子树比根节点小,右子树比根节点大 public boolean VerifySquenceOfBST(int [] sequence) { ...
2019-03-28
0
403
剑指offer(21)栈的压入弹出
package OfferTest; //栈的压入,弹出序列 import java.util.Stack; public class NoTwentyone { public static boolean IsPopOrder(int[] pushA,int[] popA){ ...
2019-03-27
0
382
剑指offer(19)顺时针打印出矩阵的元素
package OfferTest; //顺时针打印矩阵 import java.util.ArrayList; public class NoNineth { public static ArrayList<Integer> printMatrix(int[][] ...
2019-03-26
0
285
剑指offer(16)单调不减合并两个排序的链表
/* public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; } }*/ public class Solution { ...
2019-03-21
0
366
剑指offer(10)矩形覆盖
public class Solution { public int RectCover(int target) { int a = 1,b = 2,c = 0; if(target < 0){ return -1; ...
2019-03-18
0
307
剑指offer(8)跳台阶
public class Solution { public int JumpFloor(int target) { int first = 1; int second = 2; int result = 0; if(targe...
2019-03-17
0
327
剑指offer(7)斐波那契数列
public class Solution { public int Fibonacci(int n) { int a = 1,b = 1,c = 0; if(n <= 0){ return 0; }else if...
2019-03-17
0
325
首页
上一页
1
2
3
4
5
下一页
末页