桃ちゃん
桃ちゃん
全部文章
分类
题解(35)
归档
标签
去牛客网
登录
/
注册
桃ちゃん的博客
全部文章
(共34篇)
题解 | #不用加减乘除做加法#
public class Solution { public int Add(int num1,int num2) { int sum1,sum2; do{ sum1=num1^num2; sum2=(num1&...
Java
2021-09-16
0
303
题解 | #二叉树的镜像#
import java.util.*; /* * public class TreeNode { * int val = 0; * TreeNode left = null; * TreeNode right = null; * public TreeNode(int v...
Java
2021-09-15
0
399
题解 | #调整数组顺序使奇数位于偶数前面#
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param array int整型一维数组 *...
Java
2021-09-15
0
376
题解 | #合并两个排序的链表#
/* public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; } }*/ public class Solution { ...
Java
2021-09-15
0
325
题解 | #矩形覆盖#
import java.util.*; public class Solution { public int rectCover(int target) { if(target==0) return 0; if(target==1) return 1; ...
Java
2021-09-15
0
393
题解 | #斐波那契数列#
public class Solution { public int Fibonacci(int n) { if(n==0) return 0; if(n==1) return 1; if(n==2) return 1; re...
Java
2021-09-15
0
374
题解 | #旋转数组的最小数字#
import java.util.ArrayList; public class Solution { public int minNumberInRotateArray(int [] array) { int len =array.length; if(len&l...
Java
2021-09-15
0
379
题解 | #跳台阶#
public class Solution { public int jumpFloor(int target) { while(target!=0){ if(target==1){ return 1; } else if(target==2){ ...
Java
2021-09-15
0
336
题解 | #用两个栈实现队列#
import java.util.Stack; public class Solution { Stack<Integer> stack1 = new Stack<Integer>(); Stack<Integer> stack2 = new S...
Java
2021-09-15
0
326
题解 | #重建二叉树#
/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val...
Java
2021-09-15
0
375
首页
上一页
1
2
3
4
下一页
末页