首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
OutOfBoundsException
哈尔滨剑桥学院
2019届
其它
spground.github.io
关注
私信
加入黑名单
举报TA
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(33)
旋转数组的最小数字
1
#include <algorithm> class Solution { public: int minNumberInRotateArray(vector<int> rotateArray) { //就是找两个升序序列的结合处: 二分 ...
发表于 2018-09-15 09:49:29
字符串的排列
1
public ArrayList<String> Permutation(String str) { ArrayList<String> res = new ArrayList<>(); if (str != null &...
发表于 2018-03-14 12:05:44
螺旋矩阵-ii
0
public class Solution { public int[][] generateMatrix(int n) { int[][] res = new int[n][n]; int[][] dir = new int[][]{{0,1},{1,0},...
发表于 2018-02-24 18:53:29
螺旋矩阵
0
定义四个方向,然后根据逻辑切换方向。 public ArrayList spiralOrder(int[][] matrix) { ArrayList res = new ArrayList(); if (matrix == null || matrix.le...
发表于 2018-02-24 17:00:43
回文数字
1
直接求解法 public boolean isPalindrome(int x) { if (x < 10) return x >= 0; int base = 1; for (int i = x; i > 9; base *= 1...
发表于 2018-02-23 19:48:20
删除有序链表中重复的元素-I
0
public ListNode deleteDuplicates(ListNode head) { //two pointer if (head == null || head.next == null) return head; for (Lis...
发表于 2018-02-01 10:59:10
二叉树平衡检查
1
public class Checker { TreeNode prev; public boolean checkBST(TreeNode root) { // write code here if (root == null) return tru...
发表于 2018-01-26 17:00:10
网格走法数目
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int ...
发表于 2018-01-25 15:29:59
有序链表变成二叉搜索树
0
这道题OJ判定有点问题,虽然说加上高度平衡这一条件,一个中序遍历仍然是确定不了一棵树的。 当链表的节点数为偶数的时候,链表的中点有两种取法,显然OJ假设了其中一种。
发表于 2018-01-23 10:43:37
二叉树中和为某一值的路径(一)
0
public boolean hasPathSum(TreeNode root, int sum) { if (root == null) return false; if (root.left == null && root.right == nu...
发表于 2018-01-22 19:59:06
首页
上一页
1
2
3
4
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题