MCPcopy Create free account

hub / github.com/DinghaoLI/Coding-Interviews-Golang / functions

Functions178 in github.com/DinghaoLI/Coding-Interviews-Golang

↓ 1 callersFunctionprintPreOrder
(root *TreeNode)
006-重建二叉树/problem006.go:13
↓ 1 callersFunctionquickSort
要点: 注意sup的条件,确定一个数应该在前面还是后面
033-把数组排成最小的数/problem033.go:25
↓ 1 callersFunctionreConstructBinaryTree
(pre []int, in []int)
006-重建二叉树/problem006.go:29
↓ 1 callersFunctionreplaceSpace
(str []byte, length int)
004-替换空格/problem004.go:2
↓ 1 callersFunctionsup
(a, b int)
033-把数组排成最小的数/problem033.go:48
MethodLess
(i, j int)
033-把数组排成最小的数/problem033.go:69
FunctionTestQueue_IsEmpty
(t *testing.T)
007-用两个栈实现队列/problem007_test.go:7
FunctionTestQueue_Pop
(t *testing.T)
007-用两个栈实现队列/problem007_test.go:31
FunctionTestQueue_Push
(t *testing.T)
007-用两个栈实现队列/problem007_test.go:18
FunctionTestStack_Cap
(t *testing.T)
utils/stack_test.go:27
FunctionTestStack_IsEmpty
(t *testing.T)
utils/stack_test.go:18
FunctionTestStack_Len
(t *testing.T)
utils/stack_test.go:7
FunctionTestStack_Pop
(t *testing.T)
utils/stack_test.go:59
FunctionTestStack_Push
(t *testing.T)
utils/stack_test.go:36
FunctionTestStack_Top
(t *testing.T)
utils/stack_test.go:46
FunctionTest_MaxHeap
(t *testing.T)
utils/maxHeap_test.go:8
FunctionTest_MinHeap
(t *testing.T)
utils/minHeap_test.go:8
FunctionTest_OK
(t *testing.T)
004-替换空格/problem004_test.go:22
FunctionTest_OK
(t *testing.T)
003-二维数组中的查找/problem003_test.go:22
FunctionTest_case
(t *testing.T)
010-二进制中1的个数/problem010_test.go:7
FunctionTest_case
(t *testing.T)
029-数组中出现次数超过一半的数字/problem029_test.go:7
FunctionTest_case
(t *testing.T)
009-斐波那契数列/problem009_test.go:7
FunctionTest_case
(t *testing.T)
011-数值的整数次方/problem011_test.go:7
FunctionTest_case1
(t *testing.T)
008-旋转数组的最小数字/problem008_test.go:7
FunctionTest_case2
(t *testing.T)
008-旋转数组的最小数字/problem008_test.go:15
FunctionTest_case3
(t *testing.T)
008-旋转数组的最小数字/problem008_test.go:23
FunctiondeleteDuplicates
对于每一部分处理方式相同,所以我我们考虑用递归 递归 ** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */
057-删除链表中重复的结点/problem057.go:10
FunctiondetectCycle
** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ https://juejin.im/post/59e55448518825
056-链表中环的入口结点/problem056.go:19
FunctionisBalanced
递归的思想 易错点 多指返回 定义 var recur func(root *TreeNode) (int, bool) 返回值第一个为深度,第二个为是否平衡 只要遇到以下情况就返回false 1.左右子树只要有一个不平衡 2.左右子树深度相差大于一 注意返回当前深度时为 max(ldepth,
039-平衡二叉树[附加]/problem039.go:17
FunctionisMatch
DP
053-正则表达式匹配/problem053.go:8
FunctionisSymmetric
(root *TreeNode)
059-对称的二叉树/problem059.go:2
Functionmain
()
024-二叉搜索树的后序遍历序列/problem024.go:29
Functionmain
()
017-合并两个排序的链表/problem017.go:43
Functionmain
()
044-扑克牌顺子/problem044.go:27
Functionmain
()
036-数组中的逆序对/problem036.go:65
Functionmain
()
061-按之字形顺序打印二叉树/problem061.go:46
Functionmain
()
045-孩子们的游戏(圆圈中最后剩下的数)/problem045.go:18
Functionmain
()
051-数组中重复的数字/problem051.go:20
Functionmain
()
063-二叉搜索树的第K个结点/problem063.go:46
Functionmain
()
033-把数组排成最小的数/problem033.go:92
Functionmain
()
054-表示数值的字符串/problem054.go:81
Functionmain
()
049-把字符串转换成整数/problem049.go:53
Functionmain
()
037-两个链表的第一个公共结点/problem037.go:63
Functionmain
()
026-复杂链表的复制/problem026.go:46
Functionmain
()
042-左旋转字符串/problem042.go:25
Functionmain
()
015-链表中倒数第k个结点/problem015.go:31
Functionmain
()
027-二叉搜索树与双向链表/problem027.go:56
Functionmain
()
016-反转链表/problem016.go:34
Functionmain
()
023-从上往下打印二叉树/problem023.go:38
Functionmain
()
014-调整数组顺序使奇数位于偶数前面/problem014.go:28
Functionmain
()
006-重建二叉树/problem006.go:51
Functionmain
()
060-把二叉树打印成多行/problem060.go:31
Functionmain
()
064-数据流之中的中位数/problem064.go:54
Functionmain
()
047-不用加减乘除做加法/problem047.go:17
Functionmain
()
018-树的子结构/problem018.go:39
Functionmain
()
055-字符流中第一个不重复的字符/problem055.go:26
Functionmain
()
031-连续子数组的最大和/problem031.go:61
Functionmain
()
042-翻转单词顺序列/problem042.go:32
Functionmain
()
030-最小的K个数/problem030.go:35
Functionmain
()
028-字符串的排列/problem028.go:31
Functionmain
()
062-序列化二叉树/problem062.go:76
Functionmain
()
041-和为S的连续正数序列/problem041.go:31
Functionmain
()
005-从尾到头打印链表(ing)/problem005.go:21
Functionmain
()
038-数字在排序数组中出现的次数/problem038.go:35
Functionmain
()
007-用两个栈实现队列/problem007.go:43
Functionmain
()
019-二叉树的镜像/problem019.go:29
Functionmain
()
022-栈的压入弹出序列/problem022.go:31
Functionmain
()
058-二叉树的下一个结点/problem058.go:52
Functionmain
()
034-丑数/problem034.go:38
Functionmain
()
012-打印1到最大的N位数/problem012.go:55
Functionmain
()
052-构建乘积数组/problem052.go:25
Functionmain
()
035-第一个只出现一次的字符位置/problem035.go:22
Functionmain
()
032-从1到n整数中1出现的次数/problem032.go:48
Functionmax
(a,b int)
031-连续子数组的最大和/problem031.go:54
FunctionmaxDepth
(root *TreeNode)
039-二叉树的深度/problem039.go:13
FunctionmaxSlidingWindow
deque 双向队列
065-滑动窗口的最大值/problem065.go:2
FunctionsingleNumber
题目:一个整型数组里除了一个数字之外,其他的数字都出现了两次 证明:我们把每个比特分开来看,有题目可知,每个元素出现两次,只有一个元素出现一次,那么,我们只需要保留每一位比特的出现单数次的符号就可以了 比如: [4, 1, 2, 1, 2] 用二进制表示 0 1 0 0 0 0 0 1 0 0 1
040-数组中只出现一次的数字/problem040.go:22
FunctiontwoSum
把target-v当作key存入下次遇到target-v就说明找到了
041-和为S的两个数字/problem041.go:8
← previous101–178 of 178, ranked by callers