YangXian

Results 66 comments of YangXian

## 二分 - [ ] (困难)Leetcode 4. 寻找两个有序数组的中位数 [[problem]](https://leetcode-cn.com/problems/median-of-two-sorted-arrays/) - [x] (中等)Leetcode 29. 两数相除 [[problem]](https://leetcode-cn.com/problems/divide-two-integers/) - [x] (中等)Leetcode 33.搜索旋转排序数组 [[problem]](https://leetcode-cn.com/problems/search-in-rotated-sorted-array/) [[题解]](https://blog.csdn.net/Fire_to_cheat_/article/details/104196694) - [x] (中等)Leetcode 34. 在排序数组中查找元素的第一个和最后一个位置 [[problem]](https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/) - [x] (中等)Leetcode...

## Tree - [x] 199. 二叉树的右视图 [[problem]](https://leetcode-cn.com/problems/binary-tree-right-side-view/) > 给定一棵二叉树,想象自己站在它的右侧,按照从顶部到底部的顺序,返回从右侧所能看到的节点值。 > 先访问右儿子, 保存每层访问的第一个节点,就是题目要求的节点 - [x] 116. 填充每个节点的下一个右侧节点指针 > 填充 next 指针,让这个指针指向其下一个右侧节点。如果找不到下一个右侧节点,则next 指针设置为 NULL。 > 层次序遍历

## 排序 - [ ] 面试题51. 数组中的逆序对 [[problem]](https://leetcode-cn.com/problems/shu-zu-zhong-de-ni-xu-dui-lcof/) > 求数组逆序对 > 左半部分指针left, 右半部分指针right, 当nums[left] right左侧的部分,即为这一次排序过程这个数的逆序对; 所以cnt+=(right-mid-1); > 这样时间复杂度为O(nlogn); 空间复杂度为O(n);

## 树状数组 - [ ] 面试题51. 数组中的逆序对 [[problem]](https://leetcode-cn.com/problems/shu-zu-zhong-de-ni-xu-dui-lcof/)

## 快慢指针 - [x] 202. 快乐数 > 快慢指针找循环节

## 二进制 - [x] 面试题56 - I. 数组中数字出现的次数 > 一个整型数组 nums 里除两个数字之外,其他数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n),空间复杂度是O(1)。 > a^a=0 a^0=0 > 由于a,b都只有一个, 所以异或和不为0; > 那么肯定能找到一个二进制位, 这一位上a和b不同 > 那么 a=a^x1^x1^x2^x2.... > 那么b=x1^x1^x2^x2....^b

## 链表

## 栈与队列

## 二叉树

## 树状数组