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