首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
北风扬尘尘飞扬
天津大学
2023届
Java工程师
关注
私信
加入黑名单
举报TA
TA的博客
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(55)
两个链表的第一个公共结点
0
解题思路:用set即可 import java.util.HashSet; import java.util.Set; public class Solution { public ListNode FindFirstCommonNode(ListNode pHead1, ListNode pH...
发表于 2019-11-04 13:10:13
数组中的逆序对
0
public class Solution { private int ans=0; public int InversePairs(int [] array) { mergeSort(array,0,array.length-1); return...
发表于 2019-11-03 23:22:55
第一个只出现一次的字符
0
//遍历 public class Solution { static int FirstNotRepeatingChar(String str) { int first=Integer.MAX_VALUE; char c1='a'; cha...
发表于 2019-11-03 21:34:13
整数中1出现的次数(从1到n整数中1出现的次数)
0
public class Solution { public int NumberOf1Between1AndN_Solution(int n) { int ans=0; for(int i=1;i<=n;i++){ ch...
发表于 2019-11-03 20:09:49
连续子数组的最大和
0
public class Solution { public int FindGreatestSumOfSubArray(int[] array) { int max=Integer.MIN_VALUE; for(int left=0;left<arr...
发表于 2019-11-03 19:49:52
最小的K个数
0
import java.util.*; public class Solution { static ArrayList<Integer> GetLeastNumbers_Solution(int [] input, int k) { PriorityQ...
发表于 2019-11-03 19:31:19
把数组排成最小的数
0
解题思路:对数字按照序列大小排序,长度相等时用字典序,不等时需分类讨论一下。 import java.util.ArrayList; import java.util.*; public class Solution { static String PrintMinNumber(int [...
发表于 2019-11-03 19:17:07
二叉搜索树与双向链表
0
解题思路:BFS后的节点重新构造 static TreeNode Convert(TreeNode pRootOfTree) { if (pRootOfTree==null)return null; PriorityQueue<TreeNode> pq...
发表于 2019-11-03 15:37:31
复杂链表的复制
0
解题思路:处理两边即可,第一构建含有next指针的新链表,第二次添加random指针。 static RandomListNode Clone(RandomListNode pHead) { if(pHead==null)return null; //判空 ...
发表于 2019-11-03 15:07:04
数组中出现次数超过一半的数字
0
解题思路:使用Map即可。 import java.util.*; public class Solution { public int MoreThanHalfNum_Solution(int [] array) { Map<Integer, Integer> ma...
发表于 2019-10-11 22:10:45
首页
上一页
1
2
3
4
5
6
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题