You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
算法和数据结构新手班
|
|
|
|
|
|
|
|
|
|
01 位运算、算法是什么、介绍位运算和简单排序
|
|
|
|
|
|
|
|
|
|
内容:
|
|
|
|
|
|
|
|
|
|
讲解二进制、位运算
|
|
|
|
|
|
|
|
|
|
介绍什么是算法
|
|
|
|
|
|
|
|
|
|
讲解冒泡、选择、插入排序
|
|
|
|
|
|
|
|
|
|
题目:
|
|
|
|
|
|
|
|
|
|
实现打印一个整数的二进制
|
|
|
|
|
|
|
|
|
|
给定一个参数N,返回1!+2!+3!+4!+…+N!的结果
|
|
|
|
|
|
|
|
|
|
实现冒泡排序
|
|
|
|
|
|
|
|
|
|
实现选择排序
|
|
|
|
|
|
|
|
|
|
实现插入排序
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
02 数据结构的大分类、介绍前缀和与对数器
|
|
|
|
|
|
|
|
|
|
内容:
|
|
|
|
|
|
|
|
|
|
什么是数据结构、组成各种数据结构最基本的元件
|
|
|
|
|
|
|
|
|
|
前缀和数组
|
|
|
|
|
|
|
|
|
|
随机函数
|
|
|
|
|
|
|
|
|
|
对数器的使用
|
|
|
|
|
|
|
|
|
|
题目:
|
|
|
|
|
|
|
|
|
|
实现前缀和数组
|
|
|
|
|
|
|
|
|
|
如何用1~5的随机函数加工出1~7的随机函数
|
|
|
|
|
|
|
|
|
|
如何用a~b的随机函数加工出c~d的随机函数
|
|
|
|
|
|
|
|
|
|
展示对数器的使用
|
|
|
|
|
|
|
|
|
|
如何把不等概率随机函数变成等概率随机函数
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
03 介绍二分法,介绍时间复杂度、动态数组、哈希表和有序表
|
|
|
|
|
|
|
|
|
|
内容:
|
|
|
|
|
|
|
|
|
|
二分法
|
|
|
|
|
|
|
|
|
|
使用二分法解决不同的题目
|
|
|
|
|
|
|
|
|
|
时间复杂度
|
|
|
|
|
|
|
|
|
|
动态数组
|
|
|
|
|
|
|
|
|
|
按值传递、按引用传递
|
|
|
|
|
|
|
|
|
|
哈希表
|
|
|
|
|
|
|
|
|
|
有序表
|
|
|
|
|
|
|
|
|
|
题目:
|
|
|
|
|
|
|
|
|
|
有序数组中找到num
|
|
|
|
|
|
|
|
|
|
有序数组中找到>=num最左的位置
|
|
|
|
|
|
|
|
|
|
有序数组中找到<=num最右的位置
|
|
|
|
|
|
|
|
|
|
局部最小值问题
|
|
|
|
|
|
|
|
|
|
哈希表使用的code讲解
|
|
|
|
|
|
|
|
|
|
有序表使用的code讲解
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
04 链表相关的简单面试题
|
|
|
|
|
|
|
|
|
|
内容:
|
|
|
|
|
|
|
|
|
|
单双链表的定义
|
|
|
|
|
|
|
|
|
|
栈、队列
|
|
|
|
|
|
|
|
|
|
双端队列
|
|
|
|
|
|
|
|
|
|
题目:
|
|
|
|
|
|
|
|
|
|
反转单链表
|
|
|
|
|
|
|
|
|
|
反转双链表
|
|
|
|
|
|
|
|
|
|
用单链表实现队列
|
|
|
|
|
|
|
|
|
|
用单链表实现栈
|
|
|
|
|
|
|
|
|
|
用双链表实现双端队列
|
|
|
|
|
|
|
|
|
|
K个节点的组内逆序调整问题:
|
|
|
|
|
给定一个单链表的头节点head,和一个正数k
|
|
|
|
|
实现k个节点的小组内部逆序,如果最后一组不够k个就不调整
|
|
|
|
|
例子:
|
|
|
|
|
调整前:1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8,k = 3
|
|
|
|
|
调整后:3 -> 2 -> 1 -> 6 -> 5 -> 4 -> 7 -> 8
|
|
|
|
|
|
|
|
|
|
两个链表相加问题
|
|
|
|
|
给定两个链表的头节点head1和head2,
|
|
|
|
|
认为从左到右是某个数字从低位到高位,返回相加之后的链表
|
|
|
|
|
例子 4 -> 3 -> 6 2 -> 5 -> 3
|
|
|
|
|
返回 6 -> 8 -> 9
|
|
|
|
|
解释 634 + 352 = 986
|
|
|
|
|
|
|
|
|
|
两个有序链表的合并
|
|
|
|
|
给定两个有序链表的头节点head1和head2,
|
|
|
|
|
返回合并之后的大链表,要求依然有序
|
|
|
|
|
例子 1 -> 3 -> 3 -> 5 -> 7 2 -> 2 -> 3 -> 3-> 7
|
|
|
|
|
返回 1 -> 2 -> 2 -> 3 -> 3 -> 3 -> 3 -> 5 -> 7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
05 位图、位运算实现加减乘除
|
|
|
|
|
|
|
|
|
|
内容:
|
|
|
|
|
|
|
|
|
|
位图
|
|
|
|
|
|
|
|
|
|
位运算使用的进一步学习:实现加减乘除
|
|
|
|
|
|
|
|
|
|
题目:
|
|
|
|
|
|
|
|
|
|
现场写位图的code、讲解
|
|
|
|
|
|
|
|
|
|
位运算的加减乘除
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
06 比较器、优先级队列、二叉树
|
|
|
|
|
|
|
|
|
|
内容:
|
|
|
|
|
|
|
|
|
|
比较器
|
|
|
|
|
|
|
|
|
|
优先级队列
|
|
|
|
|
|
|
|
|
|
二叉树的基本遍历
|
|
|
|
|
|
|
|
|
|
二叉树的递归套路
|
|
|
|
|
|
|
|
|
|
题目:
|
|
|
|
|
|
|
|
|
|
补充了一个链表的题目
|
|
|
|
|
合并多个有序链表
|
|
|
|
|
Leetcode原题,https://leetcode.com/problems/merge-k-sorted-lists
|
|
|
|
|
|
|
|
|
|
判断两颗树是否结构相同
|
|
|
|
|
Leetcode原题,https://leetcode.com/problems/same-tree
|
|
|
|
|
|
|
|
|
|
判断一棵树是否是镜面树
|
|
|
|
|
Leetcode原题,https://leetcode.com/problems/symmetric-tree
|
|
|
|
|
|
|
|
|
|
返回一棵树的最大深度
|
|
|
|
|
Leetcode原题,https://leetcode.com/problems/maximum-depth-of-binary-tree
|
|
|
|
|
|
|
|
|
|
用先序数组和中序数组重建一棵树
|
|
|
|
|
Leetcode原题,https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
|
|
|
|
|
|
|
|
|
|
用code展示比较器的使用
|
|
|
|
|
|
|
|
|
|
二叉树先序、中序、后序遍历的代码实现、介绍递归序
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
07 继续二叉树的很多题目
|
|
|
|
|
|
|
|
|
|
内容:
|
|
|
|
|
|
|
|
|
|
进一步讲解二叉树题目,来熟悉二叉树
|
|
|
|
|
|
|
|
|
|
题目:
|
|
|
|
|
|
|
|
|
|
二叉树按层遍历并收集节点
|
|
|
|
|
Leetcode原题,https://leetcode.com/problems/binary-tree-level-order-traversal-ii
|
|
|
|
|
|
|
|
|
|
判断是否是平衡搜索二叉树
|
|
|
|
|
Leetcode原题,https://leetcode.com/problems/balanced-binary-tree
|
|
|
|
|
|
|
|
|
|
在二叉树上能否组成路径和
|
|
|
|
|
Leetcode原题,https://leetcode.com/problems/path-sum
|
|
|
|
|
|
|
|
|
|
在二叉树上收集所有达标的路径和
|
|
|
|
|
Leetcode原题,https://leetcode.com/problems/path-sum-ii
|
|
|
|
|
|
|
|
|
|
判断二叉树是否是搜索二叉树
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
08 介绍归并排序和快速排序
|
|
|
|
|
|
|
|
|
|
内容:
|
|
|
|
|
|
|
|
|
|
讲解一个位运算的题目
|
|
|
|
|
|
|
|
|
|
归并排序
|
|
|
|
|
|
|
|
|
|
快速排序
|
|
|
|
|
|
|
|
|
|
题目:
|
|
|
|
|
|
|
|
|
|
不要用任何比较判断,返回两个数中较大的数
|
|
|
|
|
|
|
|
|
|
归并排序的递归实现和非递归实现
|
|
|
|
|
|
|
|
|
|
快速排序的递归实现和非递归实现
|
|
|
|
|
|
|
|
|
|
|