1个offer就够了
1个offer就够了
全部文章
分类
笔试记录(5)
算法(13)
归档
标签
去牛客网
登录
/
注册
1个offer就够了的博客
全部文章
(共18篇)
字符串
最长回文串:https://leetcode-cn.com/problems/longest-palindrome/ class Solution { public int longestPalindrome(String s) { //先用HashMap统计字符的出现次数 M...
2020-09-04
0
494
栈与队列
队列实现栈:https://leetcode-cn.com/problems/implement-stack-using-queues/ class MyStack { Queue<Integer> queue = new LinkedList<>(); public...
2020-09-04
0
497
位运算
汉明距离(与运算):https://leetcode-cn.com/problems/hamming-distance/ 只出现1次的数(异或抵消):https://leetcode-cn.com/problems/single-number/submissions/ class Solution...
2020-09-04
0
439
贪心
跳跃游戏:https://leetcode-cn.com/problems/jump-game/class Solution { public boolean canJump(int[] nums) { //提取第一个元素作为第一次的跳跃 int jump = nums[0];...
2020-09-04
0
514
数组
旋转图像:https://leetcode-cn.com/problems/rotate-image/submissions/class Solution { public void rotate(int[][] matrix) { if(matrix.length == 0 || ma...
2020-09-04
0
450
数学
判断素数 import java.util.Scanner; public class LC { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long num = s...
2020-09-04
0
551
二叉树
0. 总结 层序遍历,从左到右。LinkedList,addLast,PollFirst。先左后右 前序遍历,Stack,push,pop,add。先右后左 中序遍历:Stack,先存入左子树,然后出栈,指向右子树 后序遍历:Stack,push,pop,addFirst。先左后右 BST中序为递...
2020-09-04
0
488
链表
1. 删除节点: 删除链表的倒数第N个节点:https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/ class Solution { public ListNode removeNthFromEnd(ListNode ...
2020-09-04
0
524
哈希表
两数之和:https://leetcode-cn.com/problems/two-sum/ class Solution { public int[] twoSum(int[] nums, int target) { Map<Integer,Integer> map = n...
2020-09-04
0
424
二分查找
开平方:https://leetcode-cn.com/problems/sqrtx/submissions/ class Solution { public int mySqrt(int x) { //双指针 int left = 1; int right = x...
2020-09-04
0
437
首页
上一页
1
2
下一页
末页