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
↓ 14 callers
Method
Push
(value interface{})
007-用两个栈实现队列/problem007.go:18
↓ 11 callers
Method
Length
Length of Maxheap
utils/maxHeap.go:22
↓ 11 callers
Method
Pop
()
007-用两个栈实现队列/problem007.go:22
↓ 10 callers
Function
isNumber
(str string)
054-表示数值的字符串/problem054.go:7
↓ 9 callers
Function
getNext
(node *TreeNode)
058-二叉树的下一个结点/problem058.go:14
↓ 8 callers
Function
getKth
(root *TreeNode, k int)
063-二叉搜索树的第K个结点/problem063.go:13
↓ 7 callers
Method
Insert
Inserting items requires ensuring the nature of the Maxheap
utils/maxHeap.go:43
↓ 7 callers
Method
Push
(value interface{})
utils/stack.go:19
↓ 6 callers
Method
GetOnceAppear
()
055-字符流中第一个不重复的字符/problem055.go:17
↓ 6 callers
Method
Insert
(char byte)
055-字符流中第一个不重复的字符/problem055.go:12
↓ 6 callers
Function
rotateString
(str string, shift int)
042-左旋转字符串/problem042.go:7
↓ 5 callers
Method
DeleteMax
Delete and return the Maximum
utils/maxHeap.go:54
↓ 5 callers
Method
DeleteMin
Delete and return the Minimum
utils/minHeap.go:54
↓ 5 callers
Method
GetMedian
()
064-数据流之中的中位数/problem064.go:39
↓ 5 callers
Method
Insert
Inserting items requires ensuring the nature of the Minheap
utils/minHeap.go:43
↓ 5 callers
Method
Insert
(num int)
064-数据流之中的中位数/problem064.go:13
↓ 5 callers
Method
IsEmpty
()
007-用两个栈实现队列/problem007.go:14
↓ 5 callers
Function
Ones
(n int)
010-二进制中1的个数/problem010.go:4
↓ 5 callers
Function
Ones
f(n) = n1*f(10bit-1) + f(n – n1*10bit) + LEFT; 其中 if(n1 == 1) LEFT = n - 10bit+ 1; else LEFT = 10bit;
032-从1到n整数中1出现的次数/problem032.go:14
↓ 5 callers
Function
Pow
(base float64, exp int)
011-数值的整数次方/problem011.go:8
↓ 5 callers
Function
minK
(nums []int, k int)
030-最小的K个数/problem030.go:9
↓ 5 callers
Function
myAtoi
(str string)
049-把字符串转换成整数/problem049.go:8
↓ 4 callers
Function
Fibonacci
(n int)
009-斐波那契数列/problem009.go:3
↓ 4 callers
Method
Len
()
utils/stack.go:7
↓ 4 callers
Function
Print
(root *TreeNode)
019-二叉树的镜像/problem019.go:22
↓ 4 callers
Method
Top
()
utils/stack.go:23
↓ 4 callers
Function
getMostFreq
(nums []int)
029-数组中出现次数超过一半的数字/problem029.go:5
↓ 4 callers
Function
inOrder
(root *TreeNode)
058-二叉树的下一个结点/problem058.go:43
↓ 4 callers
Function
kthNode
(head *NodeList, k int)
015-链表中倒数第k个结点/problem015.go:12
↓ 3 callers
Function
Add
(n, m int)
047-不用加减乘除做加法/problem047.go:7
↓ 3 callers
Method
GetMax
Get the Maximum of the Maxheap
utils/maxHeap.go:35
↓ 3 callers
Method
Length
Length of Minheap
utils/minHeap.go:22
↓ 3 callers
Method
Pop
()
utils/stack.go:30
↓ 3 callers
Function
count
Binary search
038-数字在排序数组中出现的次数/problem038.go:8
↓ 3 callers
Function
cycle
(n,m int)
045-孩子们的游戏(圆圈中最后剩下的数)/problem045.go:7
↓ 3 callers
Function
firstCommon
长链表先走,实现右对齐
037-两个链表的第一个公共结点/problem037.go:13
↓ 3 callers
Function
firstCommonMap
Hashmap
037-两个链表的第一个公共结点/problem037.go:47
↓ 3 callers
Function
hasSubRootOrTree
(p *TreeNode, c *TreeNode)
018-树的子结构/problem018.go:15
↓ 3 callers
Function
isPostOrder
(post []int)
024-二叉搜索树的后序遍历序列/problem024.go:8
↓ 3 callers
Function
max
(a, b int)
039-平衡二叉树[附加]/problem039.go:53
↓ 3 callers
Function
minNumberInRotateArray
(array []int)
008-旋转数组的最小数字/problem008.go:3
↓ 3 callers
Function
poker
(nums []int)
044-扑克牌顺子/problem044.go:8
↓ 3 callers
Function
print
(head *ListNode)
017-合并两个排序的链表/problem017.go:12
↓ 3 callers
Function
print
(head *NodeList)
016-反转链表/problem016.go:27
↓ 3 callers
Function
reverse
(head *NodeList)
016-反转链表/problem016.go:12
↓ 3 callers
Function
reverseString
(s []byte)
042-左旋转字符串/problem042.go:16
↓ 3 callers
Function
reverseString
(s []byte)
042-翻转单词顺序列/problem042.go:23
↓ 3 callers
Function
scanDigits
(str string, start int)
054-表示数值的字符串/problem054.go:48
↓ 3 callers
Function
stackOrder
(in []int, out []int)
022-栈的压入弹出序列/problem022.go:9
↓ 3 callers
Function
stringPermutation
(str string)
028-字符串的排列/problem028.go:7
↓ 2 callers
Method
GetMin
Get the Minimum of the Minheap
utils/minHeap.go:35
↓ 2 callers
Function
InversePairs
(nums []int)
036-数组中的逆序对/problem036.go:7
↓ 2 callers
Method
Max
Get the Maximum of the Maxheap
utils/maxHeap.go:27
↓ 2 callers
Function
MirrorTree
(p *TreeNode)
019-二叉树的镜像/problem019.go:15
↓ 2 callers
Function
NewMaxHeap
MaxHeap constructor
utils/maxHeap.go:15
↓ 2 callers
Function
PowNormal
(base float64, exp int)
011-数值的整数次方/problem011.go:27
↓ 2 callers
Function
PowNormal
(base float64, exp int)
012-打印1到最大的N位数/problem012.go:29
↓ 2 callers
Function
Print
(root *TreeNode)
023-从上往下打印二叉树/problem023.go:31
↓ 2 callers
Function
Serialize
(root *TreeNode)
062-序列化二叉树/problem062.go:14
↓ 2 callers
Function
TreeToList
(root *TreeNode)
027-二叉搜索树与双向链表/problem027.go:15
↓ 2 callers
Function
Zprint
(root *TreeNode)
061-按之字形顺序打印二叉树/problem061.go:13
↓ 2 callers
Function
abs
(a int)
039-平衡二叉树[附加]/problem039.go:46
↓ 2 callers
Function
again
(nums []int)
051-数组中重复的数字/problem051.go:7
↓ 2 callers
Function
arraySum
(target int)
041-和为S的连续正数序列/problem041.go:7
↓ 2 callers
Function
count
(str string)
035-第一个只出现一次的字符位置/problem035.go:7
↓ 2 callers
Function
getMinStr
(nums []int)
033-把数组排成最小的数/problem033.go:8
↓ 2 callers
Function
getTreeByLevel
(root *TreeNode)
023-从上往下打印二叉树/problem023.go:13
↓ 2 callers
Function
isE
(str string, start int)
054-表示数值的字符串/problem054.go:56
↓ 2 callers
Function
min
(a,b int)
034-丑数/problem034.go:31
↓ 2 callers
Function
oddFirst
(s []int)
014-调整数组顺序使奇数位于偶数前面/problem014.go:8
↓ 2 callers
Function
print
(head *RandNodeList)
026-复杂链表的复制/problem026.go:39
↓ 2 callers
Function
print
(root *TreeNode)
060-把二叉树打印成多行/problem060.go:13
↓ 2 callers
Function
print
(root *TreeNode)
062-序列化二叉树/problem062.go:67
↓ 2 callers
Function
printLeft
(root *TreeNode)
027-二叉搜索树与双向链表/problem027.go:48
↓ 2 callers
Function
printRight
(root *TreeNode)
027-二叉搜索树与双向链表/problem027.go:40
↓ 2 callers
Function
reverseWord
(str string)
042-翻转单词顺序列/problem042.go:7
↓ 2 callers
Function
showN
012
012-打印1到最大的N位数/problem012.go:42
↓ 1 callers
Method
Cap
()
utils/stack.go:15
↓ 1 callers
Function
CopyRandRandNodeList
(head *RandNodeList)
026-复杂链表的复制/problem026.go:13
↓ 1 callers
Function
Deserialize
(str string)
062-序列化二叉树/problem062.go:35
↓ 1 callers
Function
DeserializeTree
(str string)
062-序列化二叉树/problem062.go:42
↓ 1 callers
Function
Find
用了分治的思想,根据题意可得 从数组中选取数字,和目标数字的关系有三种情况:=,<或>。 如果是等于则查找成功; 如果是数组中元素小于要查找的数字,说明要查找的数字应该在当前位置的右边或下边。 如果是数组中元素大于要查找的数字,说明要查找的数字应该在当前位置的左边或上边。 即 对于数组中的任何一个元
003-二维数组中的查找/problem003.go:32
↓ 1 callers
Method
IsEmpty
()
utils/stack.go:11
↓ 1 callers
Function
MaxSubset
dp[i] 代表以i结尾时最大连续子数组的最大和 dp[i] 初始值为nums[0] 计算dp[i]时 如果dp[i-1]>0: 那我们放心的加进来所以dp[i] = nums[i]+dp[i-1] 否则:dp[i]取自己 dp[i] = nums[i] 再利用全局变量,保存出出现过的最大值
031-连续子数组的最大和/problem031.go:13
↓ 1 callers
Function
MaxSubset2
精简一些 dp[i] 代表以i结尾时最大连续子数组的最大和(同时) 复制nums到dp 如果dp[i-1]>0那就把dp[i]=dp[i-1]+dp[i] 再利用全局变量,保存出出现过的最大值
031-连续子数组的最大和/problem031.go:38
↓ 1 callers
Method
Min
Get the Minimum of the Minheap
utils/minHeap.go:27
↓ 1 callers
Function
MinOrder
顺序查找
008-旋转数组的最小数字/problem008.go:35
↓ 1 callers
Function
NewMinHeap
MinHeap constructor
utils/minHeap.go:15
↓ 1 callers
Function
Pow
problem 011
012-打印1到最大的N位数/problem012.go:11
↓ 1 callers
Function
SerializeTree
(root *TreeNode, str string)
062-序列化二叉树/problem062.go:23
↓ 1 callers
Function
getUgly
(N int)
034-丑数/problem034.go:7
↓ 1 callers
Function
hasSub
(p *TreeNode, c *TreeNode)
018-树的子结构/problem018.go:28
↓ 1 callers
Function
inf
(a, b int)
033-把数组排成最小的数/problem033.go:58
↓ 1 callers
Function
isDigital
(b byte)
049-把字符串转换成整数/problem049.go:46
↓ 1 callers
Function
mergeTwoLists
(l1 *ListNode, l2 *ListNode)
017-合并两个排序的链表/problem017.go:19
↓ 1 callers
Function
multiArray
(nums []int)
052-构建乘积数组/problem052.go:7
↓ 1 callers
Function
pow
(a,b int)
032-从1到n整数中1出现的次数/problem032.go:40
↓ 1 callers
Function
print
(root *TreeNode)
063-二叉搜索树的第K个结点/problem063.go:37
↓ 1 callers
Function
printInOrder
(root *TreeNode)
006-重建二叉树/problem006.go:21
↓ 1 callers
Function
printListFromTailToHead
just print it form tail to head and do not modify the original NodeList
005-从尾到头打印链表(ing)/problem005.go:14
next →
1–100 of 178, ranked by callers